3v4l.org

run code in 500+ PHP versions simultaneously
<?php class X { public function __construct( public $id, public $name, ) {} } $list = []; foreach(range(0, 10) as $i) { $list[] = new X(rand(0, 1000_000), 'name '.$i); } $map = array_column($list, null, 'id'); print_r($map) ; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 19
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 19
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/F0CR0
function name:  (null)
number of ops:  30
compiled vars:  !0 = $list, !1 = $i, !2 = $map
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   ASSIGN                                                       !0, <array>
   11     1        INIT_FCALL                                                   'range'
          2        SEND_VAL                                                     0
          3        SEND_VAL                                                     10
          4        DO_ICALL                                             $4      
          5      > FE_RESET_R                                           $5      $4, ->19
          6    > > FE_FETCH_R                                                   $5, !1, ->19
   12     7    >   NEW                                                  $7      'X'
          8        INIT_FCALL                                                   'rand'
          9        SEND_VAL                                                     0
         10        SEND_VAL                                                     1000000
         11        DO_ICALL                                             $8      
         12        SEND_VAR_NO_REF_EX                                           $8
         13        CONCAT                                               ~9      'name+', !1
         14        SEND_VAL_EX                                                  ~9
         15        DO_FCALL                                          0          
         16        ASSIGN_DIM                                                   !0
         17        OP_DATA                                                      $7
   11    18      > JMP                                                          ->6
         19    >   FE_FREE                                                      $5
   15    20        INIT_FCALL                                                   'array_column'
         21        SEND_VAR                                                     !0
         22        SEND_VAL                                                     null
         23        SEND_VAL                                                     'id'
         24        DO_ICALL                                             $11     
         25        ASSIGN                                                       !2, $11
   17    26        INIT_FCALL                                                   'print_r'
         27        SEND_VAR                                                     !2
         28        DO_ICALL                                                     
   19    29      > RETURN                                                       1

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

End of function __construct

End of class X.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.31 ms | 3542 KiB | 17 Q