3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = ['oooo', 'no', 'mmmm', 'yes']; $needle = 'Yes'; foreach ($array as $i => $v) { if (stripos($v, $needle) !== false) { $found = $i; break; } } echo $found ?? 'Not found';
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 14
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 14
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
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 = 3
Branch analysis from position: 3
Branch analysis from position: 14
Branch analysis from position: 14
filename:       /in/AkIGYk
function name:  (null)
number of ops:  19
compiled vars:  !0 = $array, !1 = $needle, !2 = $v, !3 = $i, !4 = $found
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, 'Yes'
    6     2      > FE_RESET_R                                       $7      !0, ->14
          3    > > FE_FETCH_R                                       ~8      $7, !2, ->14
          4    >   ASSIGN                                                   !3, ~8
    7     5        INIT_FCALL                                               'stripos'
          6        SEND_VAR                                                 !2
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $10     
          9        TYPE_CHECK                                  1018          $10
         10      > JMPZ                                                     ~11, ->13
    8    11    >   ASSIGN                                                   !4, !3
    9    12      > JMP                                                      ->14
    6    13    > > JMP                                                      ->3
         14    >   FE_FREE                                                  $7
   12    15        COALESCE                                         ~13     !4
         16        QM_ASSIGN                                        ~13     'Not+found'
         17        ECHO                                                     ~13
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.12 ms | 999 KiB | 14 Q