Hey.

  1. There are many built-in functions in PHP. I do not understand WHERE they are stored. For example, there is a function strlen , to which a string is given, and it returns its length as an integer number.

For example, I write $str="qwe";echo(strlen($str)); . Inside WHAT (array, object ...) is the strlen function stored? For example, $str is stored inside $GLOBALS array and $str="qwe"; script $str="qwe"; can be rewritten as $GLOBALS["$str"]="qwe";

  1. Where are embedded constants stored? For example, E_ALL .
  • four
    In libraries ( dll / so )? - user207618
  • 2
    In the executable file of the PHP interpreter, they can be stored and certainly stored. - Vladimir Martyanov
  • PHP is distributed with source code (written in C), if you are interested - download the source code and look there. for the things you have indicated, there are no objects of the PHP language to which you are used, this is reflected in a completely different form in the C code - Mike

1 answer 1

Based on the example you give, you are talking about scope.

Built-in functions are in the global scope and are accessible from any part of the program. If you use namespaces, you need to use the prefix \ - \ strlen () to access the built-in function.