3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = [0 => 'blue pants', 1 => 'red pants', 2 => 'green pants', 3 => 'green pants']; foreach ($array as $key => $value) { if (strpos($value, 'red') !== false) { echo "Key={$key}, Value: {$value}"; break; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 14
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 14
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 13
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 14
Branch analysis from position: 14
filename:       /in/Y3lTY
function name:  (null)
number of ops:  16
compiled vars:  !0 = $array, !1 = $value, !2 = $key
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    5     1      > FE_RESET_R                                           $4      !0, ->14
          2    > > FE_FETCH_R                                           ~5      $4, !1, ->14
          3    >   ASSIGN                                                       !2, ~5
    6     4        FRAMELESS_ICALL_2                strpos              ~7      !1, 'red'
          5        TYPE_CHECK                                      1018          ~7
          6      > JMPZ                                                         ~8, ->13
    7     7    >   ROPE_INIT                                         4  ~10     'Key%3D'
          8        ROPE_ADD                                          1  ~10     ~10, !2
          9        ROPE_ADD                                          2  ~10     ~10, '%2C+Value%3A+'
         10        ROPE_END                                          3  ~9      ~10, !1
         11        ECHO                                                         ~9
    8    12      > JMP                                                          ->14
    5    13    > > JMP                                                          ->2
         14    >   FE_FREE                                                      $4
   10    15      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
148.98 ms | 2264 KiB | 13 Q