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 = $a->ba(); $callable();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RfeSK
function name:  (null)
number of ops:  9
compiled vars:  !0 = $a, !1 = $callable
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $2      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   13     3        INIT_METHOD_CALL                                         !0, 'ba'
          4        DO_FCALL                                      0  $5      
          5        ASSIGN                                                   !1, $5
   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/RfeSK
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/RfeSK
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:
188.54 ms | 1393 KiB | 13 Q