3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( array( 'username' => 'user1', 'another' => 'one' ), array( 'username' => 'user2', 'another' => 'two' ) ); $username = 'user1'; $key = array_search(array('username' => $username), $array); var_dump($key); $username = 'x'; $key = array_search(array('username' => $username), $array); var_dump($key);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XhKKh
function name:  (null)
number of ops:  22
compiled vars:  !0 = $array, !1 = $username, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
    8     1        ASSIGN                                                   !1, 'user1'
    9     2        INIT_FCALL                                               'array_search'
          3        INIT_ARRAY                                       ~5      !1, 'username'
          4        SEND_VAL                                                 ~5
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $6      
          7        ASSIGN                                                   !2, $6
   10     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                                 
   12    11        ASSIGN                                                   !1, 'x'
   13    12        INIT_FCALL                                               'array_search'
         13        INIT_ARRAY                                       ~10     !1, 'username'
         14        SEND_VAL                                                 ~10
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                         $11     
         17        ASSIGN                                                   !2, $11
   14    18        INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !2
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.46 ms | 1011 KiB | 15 Q