3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = Array ( 'id' => 2, 'user' => 4, ); /** * Search for the index of a value in an array. * * @param array $array * @param string $value * * @return mixed */ function search($array, $value) { return array_search($value, $array, true); } echo search($array,2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dmIAq
function name:  (null)
number of ops:  7
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   23     1        INIT_FCALL                                               'search'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 2
          4        DO_FCALL                                      0  $2      
          5        ECHO                                                     $2
          6      > RETURN                                                   1

Function search:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dmIAq
function name:  search
number of ops:  9
compiled vars:  !0 = $array, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   20     2        INIT_FCALL                                               'array_search'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 <true>
          6        DO_ICALL                                         $2      
          7      > RETURN                                                   $2
   21     8*     > RETURN                                                   null

End of function search

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.39 ms | 956 KiB | 15 Q