3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { public function get_doable() { return array($this, 'do_it'); } private function do_it() { echo __METHOD__, "\n"; } } $foo = new foo(); $call = $foo->get_doable(); $call();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aFbsk
function name:  (null)
number of ops:  9
compiled vars:  !0 = $foo, !1 = $call
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $2      'foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   15     3        INIT_METHOD_CALL                                         !0, 'get_doable'
          4        DO_FCALL                                      0  $5      
          5        ASSIGN                                                   !1, $5
   16     6        INIT_DYNAMIC_CALL                                        !1
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Class foo:
Function get_doable:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aFbsk
function name:  get_doable
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   FETCH_THIS                                       ~0      
          1        INIT_ARRAY                                       ~1      ~0
          2        ADD_ARRAY_ELEMENT                                ~1      'do_it'
          3      > RETURN                                                   ~1
    6     4*     > RETURN                                                   null

End of function get_doable

Function do_it:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aFbsk
function name:  do_it
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ECHO                                                     'foo%3A%3Ado_it'
          1        ECHO                                                     '%0A'
   10     2      > RETURN                                                   null

End of function do_it

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.57 ms | 1394 KiB | 13 Q