3v4l.org

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

Class Foo:
Function dostuff:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3iB96
function name:  doStuff
number of ops:  3
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1      > RETURN                                                   !0
    5     2*     > RETURN                                                   null

End of function dostuff

Function dostaticstuff:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3iB96
function name:  doStaticStuff
number of ops:  3
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1      > RETURN                                                   !0
    8     2*     > RETURN                                                   null

End of function dostaticstuff

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.41 ms | 1396 KiB | 17 Q