3v4l.org

run code in 300+ PHP versions simultaneously
<?php $name="why";//声明变量$name,并初始化 function echoName1() { //在函数echoName1()里使用global来声明$name global $name; echo "the first name is ".$name."<br>"; } function echoName2() { //在函数echoName2()里没有使用global来声明$name echo "the second name is ".$name."<br>"; } echoName1(); echoName2(); $last_name = "O'Keefe"; echo $sql = "select * from users where last_name = '" . addslashes($last_name) . "'"; //这是一个测试的类,里面没有属性和方法 class Test { //调用不存的方法时自动调用的方法,第一个参数为方法名,第二个参数是数组参数 function __call($function_name, $args) { print "你所调用的函数:$function_name(参数:"; print_r($args); echo ")不存在!<br> "; } } //产生一个Test类的对象 $test=new Test(); //调用对象里不存在的方法 $test->demo("one", "two", "three"); //程序不会退出可以执行到这里 echo "this is a test<br>";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NJp8Z
function name:  (null)
number of ops:  23
compiled vars:  !0 = $name, !1 = $last_name, !2 = $sql, !3 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ASSIGN                                                   !0, 'why'
   18     1        INIT_FCALL                                               'echoname1'
          2        DO_FCALL                                      0          
   19     3        INIT_FCALL                                               'echoname2'
          4        DO_FCALL                                      0          
   21     5        ASSIGN                                                   !1, 'O%27Keefe'
   22     6        INIT_FCALL                                               'addslashes'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $8      
          9        CONCAT                                           ~9      'select+%2A+from+users+where+last_name+%3D+%27', $8
         10        CONCAT                                           ~10     ~9, '%27'
         11        ASSIGN                                           ~11     !2, ~10
         12        ECHO                                                     ~11
   39    13        NEW                                              $12     'Test'
         14        DO_FCALL                                      0          
         15        ASSIGN                                                   !3, $12
   42    16        INIT_METHOD_CALL                                         !3, 'demo'
         17        SEND_VAL_EX                                              'one'
         18        SEND_VAL_EX                                              'two'
         19        SEND_VAL_EX                                              'three'
         20        DO_FCALL                                      0          
   45    21        ECHO                                                     'this+is+a+test%3Cbr%3E'
         22      > RETURN                                                   1

Function echoname1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NJp8Z
function name:  echoName1
number of ops:  5
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   BIND_GLOBAL                                              !0, 'name'
   11     1        CONCAT                                           ~1      'the+first+name+is+', !0
          2        CONCAT                                           ~2      ~1, '%3Cbr%3E'
          3        ECHO                                                     ~2
   12     4      > RETURN                                                   null

End of function echoname1

Function echoname2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NJp8Z
function name:  echoName2
number of ops:  4
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   CONCAT                                           ~1      'the+second+name+is+', !0
          1        CONCAT                                           ~2      ~1, '%3Cbr%3E'
          2        ECHO                                                     ~2
   17     3      > RETURN                                                   null

End of function echoname2

Class Test:
Function __call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NJp8Z
function name:  __call
number of ops:  11
compiled vars:  !0 = $function_name, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   31     2        ROPE_INIT                                     3  ~3      '%E4%BD%A0%E6%89%80%E8%B0%83%E7%94%A8%E7%9A%84%E5%87%BD%E6%95%B0%EF%BC%9A'
          3        ROPE_ADD                                      1  ~3      ~3, !0
          4        ROPE_END                                      2  ~2      ~3, '%28%E5%8F%82%E6%95%B0%EF%BC%9A'
          5        ECHO                                                     ~2
   32     6        INIT_FCALL                                               'print_r'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
   33     9        ECHO                                                     '%29%E4%B8%8D%E5%AD%98%E5%9C%A8%EF%BC%81%3Cbr%3E%0A'
   35    10      > RETURN                                                   null

End of function __call

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.71 ms | 1403 KiB | 19 Q