3v4l.org

run code in 300+ PHP versions simultaneously
<?php $haystack = array( array( 'url' => '/', 'text' => 'Dashboard', array( 'url' => '/routes/', 'text' => 'Routes', array( 'url' => '/routes/directions/', 'text' => 'Directions' ), array( 'url' => '/routes/blocks/', 'text' => 'Blocks' ), array( 'url' => '/routes/headsigns/', 'text' => 'Headsigns' ), ), array( 'url' => '/fares/', 'text' => 'Fares', array( 'url' => '/fares/zones/', 'text' => 'Zones' ), array( 'url' => '/fares/fares/', 'text' => 'Rules' ) ) ) ); $needle = 'Dashboard'; $key = array_search($needle, array_column($haystack, 'text')); echo 'key = ' . $key . '<br />'; // result = 0 $needle = 'Dashboard'; $key = array_search($needle, array_column($haystack, 'text')); echo 'key = ' . $key . '<br />'; // result =
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/K4ZH6
function name:  (null)
number of ops:  28
compiled vars:  !0 = $haystack, !1 = $needle, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ASSIGN                                                   !0, <array>
   43     1        ASSIGN                                                   !1, 'Dashboard'
   44     2        INIT_FCALL                                               'array_search'
          3        SEND_VAR                                                 !1
          4        INIT_FCALL                                               'array_column'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 'text'
          7        DO_ICALL                                         $5      
          8        SEND_VAR                                                 $5
          9        DO_ICALL                                         $6      
         10        ASSIGN                                                   !2, $6
   45    11        CONCAT                                           ~8      'key+%3D+', !2
         12        CONCAT                                           ~9      ~8, '%3Cbr+%2F%3E'
         13        ECHO                                                     ~9
   48    14        ASSIGN                                                   !1, 'Dashboard'
   49    15        INIT_FCALL                                               'array_search'
         16        SEND_VAR                                                 !1
         17        INIT_FCALL                                               'array_column'
         18        SEND_VAR                                                 !0
         19        SEND_VAL                                                 'text'
         20        DO_ICALL                                         $11     
         21        SEND_VAR                                                 $11
         22        DO_ICALL                                         $12     
         23        ASSIGN                                                   !2, $12
   50    24        CONCAT                                           ~14     'key+%3D+', !2
         25        CONCAT                                           ~15     ~14, '%3Cbr+%2F%3E'
         26        ECHO                                                     ~15
   51    27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.46 ms | 1395 KiB | 17 Q