3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private function bar(){} function ba(): callable{ return [$this, "bar"]; } } $x = new A; $x = $x->ba(); $x();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/a27NX
function name:  (null)
number of ops:  9
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   13     3        INIT_METHOD_CALL                                         !0, 'ba'
          4        DO_FCALL                                      0  $4      
          5        ASSIGN                                                   !0, $4
   14     6        INIT_DYNAMIC_CALL                                        !0
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

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

End of function bar

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

End of function ba

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
186.82 ms | 1448 KiB | 13 Q