3v4l.org

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

End of Dynamic Function 1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.17 ms | 1856 KiB | 14 Q