Does C++ have less functions than PHP?

Solution:1

Both C++ and PHP have the concept of libraries which include new functions and classes..

A lot of the PHP functions are just simpler ways to do more complex things, for example, explode can be written using split and strpos instead.

Same thing for C++, I find that C++ is more lean in that aspect, sure sometimes you will have to write your own explode, or simply use some other library that someone else created.

As for which has more, I don’t think it matters, both are extensible.

Solution:2

C++ is closer to assembly language. And while there are thousands of functions part of the std library (and std++ library), it’s not surprising you feel there are more libraries in a interpreted language such as PHP (which is written in C/C++).

C and C++ each seek to provide minimal interference between the programmer and the underlying machine (while still mainlining a semblance of portability). The creation of libraries is therefore left up to the programmer to implement to suit their task at hand. While this creates more effort on your part, the resulting code can be incredibly efficient and yield impressive performance enhancements.

Of course it’s up to you to decide if the performance gains are worth the tradeoffs of increased effort.

Best of luck with your study.