3v4l.org

run code in 300+ PHP versions simultaneously
<?php //class Car //{ // public $color; // public $type; //} $myCar = new Car(); $myCar->color = 'red'; $myCar->type = 'sedan'; $yourCar = new Car(); $yourCar->color = 'blue'; $yourCar->type = 'suv'; $cars = array($myCar, $yourCar); print_r($cars); foreach ($cars as $car) { echo 'This car is a ' . $car->color . ' ' . $car->type . "\n"; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 21, Position 2 = 30
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 30
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
filename:       /in/QivlZ
function name:  (null)
number of ops:  32
compiled vars:  !0 = $myCar, !1 = $yourCar, !2 = $cars, !3 = $car
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $4      'Car'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
   11     3        ASSIGN_OBJ                                               !0, 'color'
          4        OP_DATA                                                  'red'
   12     5        ASSIGN_OBJ                                               !0, 'type'
          6        OP_DATA                                                  'sedan'
   14     7        NEW                                              $9      'Car'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $9
   15    10        ASSIGN_OBJ                                               !1, 'color'
         11        OP_DATA                                                  'blue'
   16    12        ASSIGN_OBJ                                               !1, 'type'
         13        OP_DATA                                                  'suv'
   18    14        INIT_ARRAY                                       ~14     !0
         15        ADD_ARRAY_ELEMENT                                ~14     !1
         16        ASSIGN                                                   !2, ~14
   20    17        INIT_FCALL                                               'print_r'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                                 
   21    20      > FE_RESET_R                                       $17     !2, ->30
         21    > > FE_FETCH_R                                               $17, !3, ->30
   22    22    >   FETCH_OBJ_R                                      ~18     !3, 'color'
         23        CONCAT                                           ~19     'This+car+is+a+', ~18
         24        CONCAT                                           ~20     ~19, '+'
         25        FETCH_OBJ_R                                      ~21     !3, 'type'
         26        CONCAT                                           ~22     ~20, ~21
         27        CONCAT                                           ~23     ~22, '%0A'
         28        ECHO                                                     ~23
   21    29      > JMP                                                      ->21
         30    >   FE_FREE                                                  $17
   25    31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.12 ms | 1396 KiB | 15 Q