3v4l.org

run code in 300+ PHP versions simultaneously
<?php $needlestack = [ "1" => ["fruit", "salad", "vegetable"], "2" => ["beef", "meat", "sausage"], "3" => ["chocolate", "cake", "bread"] ]; // $haystack = "I love big sausage"; $haystack = "I love big sausageS"; $found = null; foreach ($needlestack as $id => $needles) { foreach ($needles as $needle) { if (stripos($haystack, $needle) !== false) { $found = $id; break 2; } } } var_export($found);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 20
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 20
Branch analysis from position: 5
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 18
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 18
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 18
Branch analysis from position: 20
Branch analysis from position: 20
filename:       /in/F6oJb
function name:  (null)
number of ops:  25
compiled vars:  !0 = $needlestack, !1 = $haystack, !2 = $found, !3 = $needles, !4 = $id, !5 = $needle
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        ASSIGN                                                   !1, 'I+love+big+sausageS'
   12     2        ASSIGN                                                   !2, null
   13     3      > FE_RESET_R                                       $9      !0, ->20
          4    > > FE_FETCH_R                                       ~10     $9, !3, ->20
          5    >   ASSIGN                                                   !4, ~10
   14     6      > FE_RESET_R                                       $12     !3, ->18
          7    > > FE_FETCH_R                                               $12, !5, ->18
   15     8    >   INIT_FCALL                                               'stripos'
          9        SEND_VAR                                                 !1
         10        SEND_VAR                                                 !5
         11        DO_ICALL                                         $13     
         12        TYPE_CHECK                                  1018          $13
         13      > JMPZ                                                     ~14, ->17
   16    14    >   ASSIGN                                                   !2, !4
   17    15        FE_FREE                                                  $12
         16      > JMP                                                      ->20
   14    17    > > JMP                                                      ->7
         18    >   FE_FREE                                                  $12
   13    19      > JMP                                                      ->4
         20    >   FE_FREE                                                  $9
   21    21        INIT_FCALL                                               'var_export'
         22        SEND_VAR                                                 !2
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.79 ms | 1002 KiB | 15 Q