3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array(1, 2); $count = count($array); for ($i = 0; $i < $count; $i++) { echo "\nChecking $i: \n"; echo "Bad: " . $array['$i'] . "\n"; echo "Good: " . $array[$i] . "\n"; echo "Bad: {$array['$i']}\n"; echo "Good: {$array[$i]}\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 5
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 5
Branch analysis from position: 30
Branch analysis from position: 5
filename:       /in/VSgmo
function name:  (null)
number of ops:  31
compiled vars:  !0 = $array, !1 = $count, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        COUNT                                            ~4      !0
          2        ASSIGN                                                   !1, ~4
    5     3        ASSIGN                                                   !2, 0
          4      > JMP                                                      ->28
    6     5    >   ROPE_INIT                                     3  ~8      '%0AChecking+'
          6        ROPE_ADD                                      1  ~8      ~8, !2
          7        ROPE_END                                      2  ~7      ~8, '%3A+%0A'
          8        ECHO                                                     ~7
    7     9        FETCH_DIM_R                                      ~10     !0, '%24i'
         10        CONCAT                                           ~11     'Bad%3A+', ~10
         11        CONCAT                                           ~12     ~11, '%0A'
         12        ECHO                                                     ~12
    8    13        FETCH_DIM_R                                      ~13     !0, !2
         14        CONCAT                                           ~14     'Good%3A+', ~13
         15        CONCAT                                           ~15     ~14, '%0A'
         16        ECHO                                                     ~15
    9    17        ROPE_INIT                                     3  ~18     'Bad%3A+'
         18        FETCH_DIM_R                                      ~16     !0, '%24i'
         19        ROPE_ADD                                      1  ~18     ~18, ~16
         20        ROPE_END                                      2  ~17     ~18, '%0A'
         21        ECHO                                                     ~17
   10    22        ROPE_INIT                                     3  ~22     'Good%3A+'
         23        FETCH_DIM_R                                      ~20     !0, !2
         24        ROPE_ADD                                      1  ~22     ~22, ~20
         25        ROPE_END                                      2  ~21     ~22, '%0A'
         26        ECHO                                                     ~21
    5    27        PRE_INC                                                  !2
         28    >   IS_SMALLER                                               !2, !1
         29      > JMPNZ                                                    ~25, ->5
   11    30    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.26 ms | 1395 KiB | 13 Q