3v4l.org

run code in 300+ PHP versions simultaneously
<?php $products = array(); class Products { public $chemID; public $catID; } $prod1 = new Products; $prod1->chemID=1; $prod1->catID=1; array_push($products,$prod1); for($i = 1; $i < 5; $i++) { ${'prod'.$i} = new Products; ${'prod'.$i}->chemID = $i; ${'prod'.$i}->catID = $i; array_push($products,${'prod'.$i}); } $carts = (object)array(array("chemID"=> 1, "catID" => 4),array("chemID"=> 2, "catID" => 4), array("chemID"=> 1, "catID" => 1)); var_dump($carts); foreach($products as $pkey=>$pobj) { }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 14
Branch analysis from position: 36
2 jumps found. (Code = 77) Position 1 = 42, Position 2 = 45
Branch analysis from position: 42
2 jumps found. (Code = 78) Position 1 = 43, Position 2 = 45
Branch analysis from position: 43
1 jumps found. (Code = 42) Position 1 = 42
Branch analysis from position: 42
Branch analysis from position: 45
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 45
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 14
Branch analysis from position: 36
Branch analysis from position: 14
filename:       /in/2lMVE
function name:  (null)
number of ops:  47
compiled vars:  !0 = $products, !1 = $prod1, !2 = $i, !3 = $carts, !4 = $pobj, !5 = $pkey
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    8     1        NEW                                              $7      'Products'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $7
    9     4        ASSIGN_OBJ                                               !1, 'chemID'
          5        OP_DATA                                                  1
   10     6        ASSIGN_OBJ                                               !1, 'catID'
          7        OP_DATA                                                  1
   11     8        INIT_FCALL                                               'array_push'
          9        SEND_REF                                                 !0
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                                 
   12    12        ASSIGN                                                   !2, 1
         13      > JMP                                                      ->34
   13    14    >   CONCAT                                           ~14     'prod', !2
         15        NEW                                              $16     'Products'
         16        DO_FCALL                                      0          
         17        FETCH_W                      local               $15     ~14
         18        ASSIGN                                                   $15, $16
   14    19        CONCAT                                           ~19     'prod', !2
         20        FETCH_W                      local               $20     ~19
         21        ASSIGN_OBJ                                               $20, 'chemID'
         22        OP_DATA                                                  !2
   15    23        CONCAT                                           ~22     'prod', !2
         24        FETCH_W                      local               $23     ~22
         25        ASSIGN_OBJ                                               $23, 'catID'
         26        OP_DATA                                                  !2
   16    27        INIT_FCALL                                               'array_push'
         28        SEND_REF                                                 !0
         29        CONCAT                                           ~25     'prod', !2
         30        FETCH_R                      local               ~26     ~25
         31        SEND_VAL                                                 ~26
         32        DO_ICALL                                                 
   12    33        PRE_INC                                                  !2
         34    >   IS_SMALLER                                               !2, 5
         35      > JMPNZ                                                    ~29, ->14
   18    36    >   CAST                                          8  ~30     <array>
         37        ASSIGN                                                   !3, ~30
   19    38        INIT_FCALL                                               'var_dump'
         39        SEND_VAR                                                 !3
         40        DO_ICALL                                                 
   20    41      > FE_RESET_R                                       $33     !0, ->45
         42    > > FE_FETCH_R                                       ~34     $33, !4, ->45
         43    >   ASSIGN                                                   !5, ~34
         44      > JMP                                                      ->42
         45    >   FE_FREE                                                  $33
   22    46      > RETURN                                                   1

Class Products: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.84 ms | 1400 KiB | 17 Q