3v4l.org

run code in 300+ PHP versions simultaneously
<?php $userdb = [ [ '100', 'Sandra', 'urlof100' ], [ '5465', 'Stefanie', 'urlof5465' ], [ '40489', 'Michael', 'urlof40489' ] ]; function getRow($find,$db,$col){ $key = array_search($find, array_column($db, $col)); if ($key !== false) { echo "Yes, \"$find\" is in array in row $key\n"; } return $db[$key]; } $row = getRow('Sandra',$userdb,1); print_r($row);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y90XS
function name:  (null)
number of ops:  11
compiled vars:  !0 = $userdb, !1 = $row
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   27     1        INIT_FCALL                                               'getrow'
          2        SEND_VAL                                                 'Sandra'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 1
          5        DO_FCALL                                      0  $3      
          6        ASSIGN                                                   !1, $3
   28     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function getrow:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 20
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/Y90XS
function name:  getRow
number of ops:  23
compiled vars:  !0 = $find, !1 = $db, !2 = $col, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   21     3        INIT_FCALL                                               'array_search'
          4        SEND_VAR                                                 !0
          5        INIT_FCALL                                               'array_column'
          6        SEND_VAR                                                 !1
          7        SEND_VAR                                                 !2
          8        DO_ICALL                                         $4      
          9        SEND_VAR                                                 $4
         10        DO_ICALL                                         $5      
         11        ASSIGN                                                   !3, $5
   22    12        TYPE_CHECK                                  1018          !3
         13      > JMPZ                                                     ~7, ->20
   23    14    >   ROPE_INIT                                     5  ~9      'Yes%2C+%22'
         15        ROPE_ADD                                      1  ~9      ~9, !0
         16        ROPE_ADD                                      2  ~9      ~9, '%22+is+in+array+in+row+'
         17        ROPE_ADD                                      3  ~9      ~9, !3
         18        ROPE_END                                      4  ~8      ~9, '%0A'
         19        ECHO                                                     ~8
   25    20    >   FETCH_DIM_R                                      ~12     !1, !3
         21      > RETURN                                                   ~12
   26    22*     > RETURN                                                   null

End of function getrow

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.99 ms | 1399 KiB | 20 Q