PHP VLD analyzes different function behaviors at the system level

  • We can use VLD to see the underlying operations, including what each function is doing, which system calls are in progress.

  • Install

 1. pecl install channel://pecl.php.net/vld-0.14.0//The version itself is selected according to the situation  2.Modify php.ini
 3.Check if phpinfo has vld

vld using

//test.php
echo "hello"." "."world!";
//cli mode, some analysis information will appear after execution
/usr/local/php72/bin/php -dvld.active=1 ./test.php

Result Analysis

The following shows the Opcode information executed by the php script. The output contains the number of operations performed, and the table contains the execution operations. PHP code line number

Finding entry points
Branch analysis from position: 0
Jump found. (Code = 62) Position 1 = -2
filename:       /data/machine/public/test.php
function name:  (null)
number of ops:  3  // The total number of operations performed at the Opcode level when the code is running compiled vars:none //All variable set output 
line     #* EIO op (name of the operation ) fetch ext return operands
-------------------------------------------------------------------------------------
   2     0  E >   EXT_STMT                                                 
         1        ECHO                                                     'hello+world%21'
   3     2      > RETURN                                                   1

branch: #  0; line:     2-    3; sop:     0; eop:     2; out1:  -2
path #1: 0, 

reference

High-performance PHP application development