3v4l.org

run code in 500+ PHP versions simultaneously
<?php $human = (object) [ 'name' => 'John Doe', 'age' => 25, 'getName' => function() { global $human; var_dump($human->name); }, 'getAge' => function() { global $human; var_dump($human->age); }, ]; ($human->getName)(); ($human->getAge)();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z9pN7
function name:  (null)
number of ops:  15
compiled vars:  !0 = $human
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   INIT_ARRAY                                           ~1      'John+Doe', 'name'
    5     1        ADD_ARRAY_ELEMENT                                    ~1      25, 'age'
    6     2        DECLARE_LAMBDA_FUNCTION                              ~2      [0]
    9     3        ADD_ARRAY_ELEMENT                                    ~1      ~2, 'getName'
   10     4        DECLARE_LAMBDA_FUNCTION                              ~3      [1]
   13     5        ADD_ARRAY_ELEMENT                                    ~1      ~3, 'getAge'
          6        CAST                                              8  ~4      ~1
    3     7        ASSIGN                                                       !0, ~4
   16     8        FETCH_OBJ_R                                          ~6      !0, 'getName'
          9        INIT_DYNAMIC_CALL                                            ~6
         10        DO_FCALL                                          0          
   17    11        FETCH_OBJ_R                                          ~8      !0, 'getAge'
         12        INIT_DYNAMIC_CALL                                            ~8
         13        DO_FCALL                                          0          
         14      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z9pN7
function name:  {closure:/in/Z9pN7:6}
number of ops:  6
compiled vars:  !0 = $human
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   BIND_GLOBAL                                                  !0, 'human'
    8     1        INIT_FCALL                                                   'var_dump'
          2        FETCH_OBJ_R                                          ~1      !0, 'name'
          3        SEND_VAL                                                     ~1
          4        DO_ICALL                                                     
    9     5      > RETURN                                                       null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z9pN7
function name:  {closure:/in/Z9pN7:10}
number of ops:  6
compiled vars:  !0 = $human
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   BIND_GLOBAL                                                  !0, 'human'
   12     1        INIT_FCALL                                                   'var_dump'
          2        FETCH_OBJ_R                                          ~1      !0, 'age'
          3        SEND_VAL                                                     ~1
          4        DO_ICALL                                                     
   13     5      > RETURN                                                       null

End of Dynamic Function 1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
166.55 ms | 1856 KiB | 14 Q