3v4l.org

run code in 300+ PHP versions simultaneously
<?php $Foo = call_user_func(function() { $a = function() { return 'hello'; }; $b = function() { return 'world'; }; return (object)array( 'a' => $a, 'b' => $b, ); }); echo implode(' ', array(($Foo->a)(), ($Foo->b)()));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/p0B1H
function name:  (null)
number of ops:  18
compiled vars:  !0 = $Foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fp0B1H%3A2%240'
   14     1        INIT_USER_CALL                                0          'call_user_func', ~1
          2        DO_FCALL                                      0  $2      
    2     3        ASSIGN                                                   !0, $2
   18     4        INIT_FCALL                                               'implode'
          5        SEND_VAL                                                 '+'
          6        FETCH_OBJ_R                                      ~4      !0, 'a'
          7        INIT_DYNAMIC_CALL                                        ~4
          8        DO_FCALL                                      0  $5      
          9        INIT_ARRAY                                       ~6      $5
         10        FETCH_OBJ_R                                      ~7      !0, 'b'
         11        INIT_DYNAMIC_CALL                                        ~7
         12        DO_FCALL                                      0  $8      
         13        ADD_ARRAY_ELEMENT                                ~6      $8
         14        SEND_VAL                                                 ~6
         15        DO_ICALL                                         $9      
         16        ECHO                                                     $9
         17      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fp0B1H%3A2%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/p0B1H
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fp0B1H%3A3%241'
          1        ASSIGN                                                   !0, ~2
    6     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fp0B1H%3A6%242'
          3        ASSIGN                                                   !1, ~4
   11     4        INIT_ARRAY                                       ~6      !0, 'a'
   12     5        ADD_ARRAY_ELEMENT                                ~6      !1, 'b'
          6        CAST                                          8  ~7      ~6
          7      > RETURN                                                   ~7
   14     8*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fp0B1H%3A2%240

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

End of function %00%7Bclosure%7D%2Fin%2Fp0B1H%3A3%241

Function %00%7Bclosure%7D%2Fin%2Fp0B1H%3A6%242:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/p0B1H
function name:  {closure}
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                   'world'
    8     1*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fp0B1H%3A6%242

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.01 ms | 1400 KiB | 15 Q