3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function foo() { return 'foo'; } public function __destruct() { return 'die'; } } $test = new Test; $test->foo(); $var1 = call_user_func(array($test, 'foo')); $var2 = call_user_func(array(&$test, 'foo')); var_dump($var1, $var2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GUY4v
function name:  (null)
number of ops:  20
compiled vars:  !0 = $test, !1 = $var1, !2 = $var2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $3      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   16     3        INIT_METHOD_CALL                                         !0, 'foo'
          4        DO_FCALL                                      0          
   18     5        INIT_ARRAY                                       ~7      !0
          6        ADD_ARRAY_ELEMENT                                ~7      'foo'
          7        INIT_USER_CALL                                0          'call_user_func', ~7
          8        DO_FCALL                                      0  $8      
          9        ASSIGN                                                   !1, $8
   20    10        INIT_ARRAY                                       ~10     !0
         11        ADD_ARRAY_ELEMENT                                ~10     'foo'
         12        INIT_USER_CALL                                0          'call_user_func', ~10
         13        DO_FCALL                                      0  $11     
         14        ASSIGN                                                   !2, $11
   21    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !1
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Class Test:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GUY4v
function name:  foo
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E > > RETURN                                                   'foo'
    7     1*     > RETURN                                                   null

End of function foo

Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GUY4v
function name:  __destruct
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E > > RETURN                                                   'die'
   11     1*     > RETURN                                                   null

End of function __destruct

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.36 ms | 1396 KiB | 15 Q