3v4l.org

run code in 300+ PHP versions simultaneously
<?php class C { static function f() { return function() { return $this; }; } } $f = (new C)->f(); var_dump($f->call(new stdClass));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FObAA
function name:  (null)
number of ops:  14
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $1      'C'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $1, 'f'
          3        DO_FCALL                                      0  $3      
          4        ASSIGN                                                   !0, $3
   12     5        INIT_FCALL                                               'var_dump'
          6        INIT_METHOD_CALL                                         !0, 'call'
          7        NEW                                              $5      'stdClass'
          8        DO_FCALL                                      0          
          9        SEND_VAR_NO_REF_EX                                       $5
         10        DO_FCALL                                      0  $7      
         11        SEND_VAR                                                 $7
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Class C:
Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FObAA
function name:  f
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   DECLARE_LAMBDA_FUNCTION                          ~0      [0]
    7     1      > RETURN                                                   ~0
    8     2*     > RETURN                                                   null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FObAA
function name:  {closure}
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   FETCH_THIS                                       ~0      
          1      > RETURN                                                   ~0
    7     2*     > RETURN                                                   null

End of Dynamic Function 0

End of function f

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.64 ms | 998 KiB | 14 Q