Use Strace to view the PHP source code for C language

If you want to see the C language level PHP code, you need to use Strace

This default is installed. If there is no installation

#yum install strace

View httpd process (no web server needs to be installed)

#ps auxw | grep httpd

Apache

[Root @ local / webserver / apache2 / bin / apachectl stop

start single process httpd

[root @ localhost usr] # / usr / local / webserver / apache2 / bin / apachectl -x -k start

Use #ps auxwww | grep httpd View only single Often, write down the process ID

bind Strace to Apache

#strace -p 28224

algorithm

Rapid sorting PHP code

[PHP] View Plain Copy

Function Quicksort ($ ARR) <?php  

{

$ LEN = Count ($ arr);

IF ($ LEN

Return $ Arr; <= 1) {  

}

$ Key = $ arr [0];

$ Left_arr= array ();

$ right_arr = array ();

for ($ I = 1; $ i

IF ( $ ARR [$ I]

$ left_arr [] = $ arr [$ I];

<$len; $i++){  

} else {

<= $key){  

$ right_arr [] = $ arr [$ i]

}

$ LEFT_ARR = Quicksort ($ Left_arr);

$ Right_arr = Quicksort $ Right_arr);

RTURN Array_Merge ($ LEFT_ARR, Array ($ Key), $ Right_arr);

}

$ arr = array (6, 3, 8, 5, 9, 2, 10);

‘;

Print_R (Quicksort $ ARR);

In the browser requests the PHP page, get tracking information

You can use the function to view the called function Description

, such as: man command check getsockname

使用strace查看C语言的php源码

example http://www.cnblogs.com/ggjucheng / Archive / 2012/01/08 / 2316692.html

© Copyright Notice
THE END
Just support it if you like
like0
share
comment Grab the couch

Please log in to comment