3v4l.org

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