3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = ['something', 'something else', 'another something']; $old_value = ""; foreach ($arr as $key => $value) { if ($old_value == $value) { $colour = 'blue'; } else { $colour = 'yellow'; $old_value = $value; } echo '<td style="background-color:' .$colour . '">' . $value . '</td>'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 17
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 17
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/ePKGu
function name:  (null)
number of ops:  19
compiled vars:  !0 = $arr, !1 = $old_value, !2 = $value, !3 = $key, !4 = $colour
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, ''
    4     2      > FE_RESET_R                                       $7      !0, ->17
          3    > > FE_FETCH_R                                       ~8      $7, !2, ->17
          4    >   ASSIGN                                                   !3, ~8
    6     5        IS_EQUAL                                                 !1, !2
          6      > JMPZ                                                     ~10, ->9
    8     7    >   ASSIGN                                                   !4, 'blue'
          8      > JMP                                                      ->11
   12     9    >   ASSIGN                                                   !4, 'yellow'
   13    10        ASSIGN                                                   !1, !2
   15    11    >   CONCAT                                           ~14     '%3Ctd+style%3D%22background-color%3A', !4
         12        CONCAT                                           ~15     ~14, '%22%3E'
         13        CONCAT                                           ~16     ~15, !2
         14        CONCAT                                           ~17     ~16, '%3C%2Ftd%3E'
         15        ECHO                                                     ~17
    4    16      > JMP                                                      ->3
         17    >   FE_FREE                                                  $7
   17    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155 ms | 1385 KiB | 13 Q