3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a=array("a"=>"red","b"=>"green","c"=>"blue"); $found = false; $string = "red"; foreach($a as $item) { if($found == false) { preg_match("/$string/",$item); } } echo $found; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 15
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 14
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 14
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/jNZCo
function name:  (null)
number of ops:  18
compiled vars:  !0 = $a, !1 = $found, !2 = $string, !3 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, <false>
    4     2        ASSIGN                                                   !2, 'red'
    5     3      > FE_RESET_R                                       $7      !0, ->15
          4    > > FE_FETCH_R                                               $7, !3, ->15
    6     5    >   BOOL_NOT                                         ~8      !1
          6      > JMPZ                                                     ~8, ->14
    7     7    >   INIT_FCALL                                               'preg_match'
          8        ROPE_INIT                                     3  ~10     '%2F'
          9        ROPE_ADD                                      1  ~10     ~10, !2
         10        ROPE_END                                      2  ~9      ~10, '%2F'
         11        SEND_VAL                                                 ~9
         12        SEND_VAR                                                 !3
         13        DO_ICALL                                                 
    5    14    > > JMP                                                      ->4
         15    >   FE_FREE                                                  $7
   10    16        ECHO                                                     !1
   11    17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.17 ms | 1395 KiB | 15 Q