3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Human { private $name, $age; public function __construct($name, $age) { $this->name = $name; $this->age = $age; } } $data = [["John", 23], ["Nick", 32], ["Ann", 17]]; $humans = []; foreach($data as $item) { $humans[] = call_user_func_array(['Human','__construct'], $item); } var_dump($humans);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 11
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/m5N4N
function name:  (null)
number of ops:  16
compiled vars:  !0 = $data, !1 = $humans, !2 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN                                                   !0, <array>
   15     1        ASSIGN                                                   !1, <array>
   16     2      > FE_RESET_R                                       $5      !0, ->11
          3    > > FE_FETCH_R                                               $5, !2, ->11
   18     4    >   INIT_USER_CALL                                0          'call_user_func_array', <array>
          5        SEND_ARRAY                                               !2
          6        CHECK_UNDEF_ARGS                                         
          7        DO_FCALL                                      0  $7      
          8        ASSIGN_DIM                                               !1
          9        OP_DATA                                                  $7
   16    10      > JMP                                                      ->3
         11    >   FE_FREE                                                  $5
   21    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Class Human:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/m5N4N
function name:  __construct
number of ops:  7
compiled vars:  !0 = $name, !1 = $age
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    8     2        ASSIGN_OBJ                                               'name'
          3        OP_DATA                                                  !0
    9     4        ASSIGN_OBJ                                               'age'
          5        OP_DATA                                                  !1
   10     6      > RETURN                                                   null

End of function __construct

End of class Human.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.18 ms | 1401 KiB | 15 Q