10

How can I count the total number of built-in functions in PHP, latest version?

4
  • 2
    Define "built-in". Do you mean in the core engine, or also in the common extensions? If so, what extensions? Feb 11, 2010 at 10:37
  • this is like a game-show question where you have to guess what something costs. Feb 11, 2010 at 10:39
  • 1
    that would be a cool game show. I take "Multi-threaded Fun" for 200.
    – Thilo
    Feb 11, 2010 at 10:50
  • 2
    I'd be more interested in the total number of accepted questions by coderex
    – Gordon
    Feb 11, 2010 at 10:54

5 Answers 5

41

You could use a core function to count the number of functions available in the core and installed extensions:

$funcs = get_defined_functions();
echo count($funcs['internal']);
2
  • 7
    +1 This is my favourite and completely version-independent.
    – Pekka
    Feb 11, 2010 at 12:06
  • 1
    This should be marked as the correct answer. Dec 1, 2015 at 19:18
11

Count them here:

PHP Function List

Here is a list of all the documented PHP functions. Click on any one of them to jump to that page in the manual...

2
  • 5
    +1 Ahh yes, the Rainman approach. Functions .. toothpicks, cards, what's the difference? :)
    – Tim Post
    Feb 11, 2010 at 10:39
  • 7
    This link no longer works Dec 13, 2014 at 4:36
1

There are 5845 listed function here at PHP website

0
1

PHP site shows a total of 5368 functions.

2
  • 1
    I get 5701 just like Robin - you must be missing a few! ;)
    – meouw
    Feb 11, 2010 at 10:47
  • 5
    I swear, i counted like three times.
    – alexn
    Feb 11, 2010 at 12:09
0

http://php.net/quickref.php

I selected all the functions listed on that page and pasted into a text editor.. i got 5011 lines which means that there are 5011 functions, if i am not wrong.

2
  • Question is closed, what's the point on answering?
    – Yaroslav
    Oct 10, 2012 at 18:34
  • The link is dead, and this answer has been provided before. Dec 1, 2015 at 19:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.