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') ); $valueToFind = '0634345675'; if (in_array($valueToFind, array_column($array, 'number'))){ echo 'value found'; echo PHP_EOL; $key = array_search($valueToFind, array_column($array, 'number')); echo "matched array is"; echo PHP_EOL; print_r($array[$key]); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 28
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/ZlYGp
function name:  (null)
number of ops:  29
compiled vars:  !0 = $array, !1 = $valueToFind, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        ASSIGN                                                   !1, '0634345675'
   11     2        INIT_FCALL                                               'in_array'
          3        SEND_VAR                                                 !1
          4        INIT_FCALL                                               'array_column'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 'number'
          7        DO_ICALL                                         $5      
          8        SEND_VAR                                                 $5
          9        DO_ICALL                                         $6      
         10      > JMPZ                                                     $6, ->28
   13    11    >   ECHO                                                     'value+found'
   15    12        ECHO                                                     '%0A'
   17    13        INIT_FCALL                                               'array_search'
         14        SEND_VAR                                                 !1
         15        INIT_FCALL                                               'array_column'
         16        SEND_VAR                                                 !0
         17        SEND_VAL                                                 'number'
         18        DO_ICALL                                         $7      
         19        SEND_VAR                                                 $7
         20        DO_ICALL                                         $8      
         21        ASSIGN                                                   !2, $8
   19    22        ECHO                                                     'matched+array+is'
   21    23        ECHO                                                     '%0A'
   23    24        INIT_FCALL                                               'print_r'
         25        FETCH_DIM_R                                      ~10     !0, !2
         26        SEND_VAL                                                 ~10
         27        DO_ICALL                                                 
   24    28    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.36 ms | 1013 KiB | 17 Q