3v4l.org

run code in 300+ PHP versions simultaneously
<?php $c = new StdClass; $c->something = function(){ var_dump("A"); return function(){ var_dump('B');}; }; $k = $c->something; var_dump($k());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1hpIC
function name:  (null)
number of ops:  14
compiled vars:  !0 = $c, !1 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $2      'StdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    5     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F1hpIC%3A5%240'
          4        ASSIGN_OBJ                                               !0, 'something'
    8     5        OP_DATA                                                  ~6
   10     6        FETCH_OBJ_R                                      ~7      !0, 'something'
          7        ASSIGN                                                   !1, ~7
   11     8        INIT_FCALL                                               'var_dump'
          9        INIT_DYNAMIC_CALL                                        !1
         10        DO_FCALL                                      0  $9      
         11        SEND_VAR                                                 $9
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F1hpIC%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1hpIC
function name:  {closure}
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 'A'
          2        DO_ICALL                                                 
    7     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F1hpIC%3A7%241'
          4      > RETURN                                                   ~1
    8     5*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F1hpIC%3A5%240

Function %00%7Bclosure%7D%2Fin%2F1hpIC%3A7%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1hpIC
function name:  {closure}
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 'B'
          2        DO_ICALL                                                 
          3      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F1hpIC%3A7%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.9 ms | 1388 KiB | 15 Q