Where is the main () method in the source of the PHP interpreter?

When I read the PHP source code written in C , I cannot find the main() method; can someone help me?

+6
source share
2 answers

The main() functions in PHP are defined in SAPI because they are specific to the mode in which PHP is executed. For example, for the SAPI command line, it is defined in sapi/cli/php_cli.c ; for CGI / FastCGI SAPI, it is defined in sapi/cgi/cgi_main.c .

Some other SAPIs, such as apache2 SAPI, do not define the main() function at all, since they are loaded only as a separate separate executable file.

+11
source

PHP does not have a main method such as C.

PHP runs from top to bottom or can be called from HTML using methods.

 <?php echo "echo" echo "echo 2" ?> 

PHP will run from an open tag to a closing tag.

Repeat echo and echo 2 in order.

-4
source

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


All Articles