3v4l.org

run code in 300+ PHP versions simultaneously
<?php function doWork(callable $f){ $f(); } class P { function test(){ echo 'parent'; } } class C extends P{ function register(){ doWork([$this, 'test']); } } (new C)->register();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C3ZWI
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $0      'C'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'register'
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

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

End of function dowork

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

End of function test

End of class P.

Class C:
Function register:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C3ZWI
function name:  register
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'dowork'
          1        FETCH_THIS                                       ~0      
          2        INIT_ARRAY                                       ~1      ~0
          3        ADD_ARRAY_ELEMENT                                ~1      'test'
          4        SEND_VAL                                                 ~1
          5        DO_FCALL                                      0          
   16     6      > RETURN                                                   null

End of function register

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

End of function test

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.74 ms | 1007 KiB | 14 Q