3v4l.org

run code in 300+ 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 = 17
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 17
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 16
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 17
Branch analysis from position: 17
filename:       /in/Y3lTY
function name:  (null)
number of ops:  19
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, ->17
          2    > > FE_FETCH_R                                       ~5      $4, !1, ->17
          3    >   ASSIGN                                                   !2, ~5
    6     4        INIT_FCALL                                               'strpos'
          5        SEND_VAR                                                 !1
          6        SEND_VAL                                                 'red'
          7        DO_ICALL                                         $7      
          8        TYPE_CHECK                                  1018          $7
          9      > JMPZ                                                     ~8, ->16
    7    10    >   ROPE_INIT                                     4  ~10     'Key%3D'
         11        ROPE_ADD                                      1  ~10     ~10, !2
         12        ROPE_ADD                                      2  ~10     ~10, '%2C+Value%3A+'
         13        ROPE_END                                      3  ~9      ~10, !1
         14        ECHO                                                     ~9
    8    15      > JMP                                                      ->17
    5    16    > > JMP                                                      ->2
         17    >   FE_FREE                                                  $4
   10    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.02 ms | 999 KiB | 14 Q