Why do we use code like "call_user_func ($ callback, $ param)" insteed "$ callback ($ param)"

PHP is just a scripting language, so we can do a lot of simple and efficient ones. Why not use the simple and easy way to do it like "$ callback ($ param)"?

+4
source share
1 answer

not sure, but I might think that later it is just a synonym for the first. therefore internally can change php.

Even if not, I like the option of having both ways, because for those who are not developing in PHP, the later may not be very intuitive, but the function call is pretty similar to all languages.

EDIT: A good read about this can be found here ...

+1
source

Source: https://habr.com/ru/post/1495126/


All Articles