3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function __construct($data) { array_map(function($field) use ($data) { $this->$field = $data[$field]; }, array_keys($data)); print_r(get_object_vars($this)); } } $a = new A(['hej' => 'san', 'hopp' => 'san']);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ViUoh
function name:  (null)
number of ops:  5
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $1      'A'
          1        SEND_VAL_EX                                              <array>
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
          4      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FViUoh%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ViUoh
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $field, !1 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
    8     2        FETCH_THIS                                       $2      
          3        FETCH_DIM_R                                      ~4      !1, !0
          4        ASSIGN_OBJ                                               $2, !0
          5        OP_DATA                                                  ~4
    9     6      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FViUoh%3A7%240

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ViUoh
function name:  __construct
number of ops:  18
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        INIT_FCALL                                               'array_map'
          2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FViUoh%3A7%240'
          3        BIND_LEXICAL                                             ~1, !0
    9     4        SEND_VAL                                                 ~1
          5        INIT_FCALL                                               'array_keys'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $2      
          8        SEND_VAR                                                 $2
          9        DO_ICALL                                                 
   11    10        INIT_FCALL                                               'print_r'
         11        INIT_FCALL                                               'get_object_vars'
         12        FETCH_THIS                                       ~4      
         13        SEND_VAL                                                 ~4
         14        DO_ICALL                                         $5      
         15        SEND_VAR                                                 $5
         16        DO_ICALL                                                 
   12    17      > RETURN                                                   null

End of function __construct

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.23 ms | 1396 KiB | 21 Q