3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Bar { private function doFoo() { echo 'yes'; } public function doBar() { $cb = ['Bar', 'doFoo']; $cb(); $cb = [$this, 'doFoo']; $cb(); } } $b = new Bar(); $b->doBar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ItoqW
function name:  (null)
number of ops:  6
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $1      'Bar'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   20     3        INIT_METHOD_CALL                                         !0, 'doBar'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

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

End of function dofoo

Function dobar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ItoqW
function name:  doBar
number of ops:  10
compiled vars:  !0 = $cb
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ASSIGN                                                   !0, <array>
   13     1        INIT_DYNAMIC_CALL                                        !0
          2        DO_FCALL                                      0          
   14     3        FETCH_THIS                                       ~3      
          4        INIT_ARRAY                                       ~4      ~3
          5        ADD_ARRAY_ELEMENT                                ~4      'doFoo'
          6        ASSIGN                                                   !0, ~4
   15     7        INIT_DYNAMIC_CALL                                        !0
          8        DO_FCALL                                      0          
   16     9      > RETURN                                                   null

End of function dobar

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.74 ms | 1010 KiB | 13 Q