PHP - Writing your own VS function using built-in functions

Are there any advantages to using box functions, such as array_map, rather than writing your own loop (when you know that the box function cannot be written in any other way than your own function?

(why? sometimes it is more readable when the function callbackis customizable)

+3
source share
2 answers

Built-in functions will always be faster vs the same implementation in PHP. The built-in function will be executed in C, and the PHP function will be interpreted in C, and then executed.

+6
source

, C, , php...

, .

+2

All Articles