3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( array('name' => 'number1', 'number' => '0612345675'), array('name' => 'number2', 'number' => '0634345675'), array('name' => 'number3', 'number' => '0634378675'), array('name' => 'number4', 'number' => '0634378675'), ); $valueToFind = '0634378675'; $matchedArray = array(); foreach($array as $arr){ if($valueToFind == $arr['number']){ $matchedArray[] = $arr; } } if( count($matchedArray) > 0){ echo "match found"; echo PHP_EOL; print_r($matchedArray); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 11
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 10
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 20
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
Branch analysis from position: 11
filename:       /in/p439T
function name:  (null)
number of ops:  21
compiled vars:  !0 = $array, !1 = $valueToFind, !2 = $matchedArray, !3 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        ASSIGN                                                   !1, '0634378675'
   12     2        ASSIGN                                                   !2, <array>
   13     3      > FE_RESET_R                                       $7      !0, ->11
          4    > > FE_FETCH_R                                               $7, !3, ->11
   14     5    >   FETCH_DIM_R                                      ~8      !3, 'number'
          6        IS_EQUAL                                                 !1, ~8
          7      > JMPZ                                                     ~9, ->10
   15     8    >   ASSIGN_DIM                                               !2
          9        OP_DATA                                                  !3
   13    10    > > JMP                                                      ->4
         11    >   FE_FREE                                                  $7
   19    12        COUNT                                            ~11     !2
         13        IS_SMALLER                                               0, ~11
         14      > JMPZ                                                     ~12, ->20
   20    15    >   ECHO                                                     'match+found'
   21    16        ECHO                                                     '%0A'
   22    17        INIT_FCALL                                               'print_r'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                                 
   23    20    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.56 ms | 998 KiB | 14 Q