3v4l.org

run code in 500+ PHP versions simultaneously
<?php $readJson = [ [ 'id' => 78, 'name' => 'audi', 'sscat_id' => 59, 'date' => '0000-00-00 00:00:00' ], [ 'id' => 106, 'name' => 'apache', 'sscat_id' => 86, 'date' => '0000-00-00 00:00:00' ], [ 'id' => 16, 'name' => 'asia', 'sscat_id' => 62, 'date' => '0000-00-00 00:00:00' ] ]; $_GET['b'] = 16; // test case for echoing one //$_GET['b'] = 99; // test case for echoing all $lookup = array_column($readJson, 'name', 'id'); echo $lookup[$_GET["b"]] ?? implode(', ', $lookup);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qJ12Z
function name:  (null)
number of ops:  18
compiled vars:  !0 = $readJson, !1 = $lookup
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
   23     1        FETCH_W                          global              $3      '_GET'
          2        ASSIGN_DIM                                                   $3, 'b'
          3        OP_DATA                                                      16
   26     4        INIT_FCALL                                                   'array_column'
          5        SEND_VAR                                                     !0
          6        SEND_VAL                                                     'name'
          7        SEND_VAL                                                     'id'
          8        DO_ICALL                                             $5      
          9        ASSIGN                                                       !1, $5
   27    10        FETCH_R                          global              ~7      '_GET'
         11        FETCH_DIM_R                                          ~8      ~7, 'b'
         12        FETCH_DIM_IS                                         ~9      !1, ~8
         13        COALESCE                                             ~10     ~9
         14        FRAMELESS_ICALL_2                implode             ~11     '%2C+', !1
         15        QM_ASSIGN                                            ~10     ~11
         16        ECHO                                                         ~10
         17      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.73 ms | 1850 KiB | 14 Q