3v4l.org

run code in 300+ 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:  21
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        INIT_FCALL                                               'implode'
         15        SEND_VAL                                                 '%2C+'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $11     
         18        QM_ASSIGN                                        ~10     $11
         19        ECHO                                                     ~10
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.44 ms | 1011 KiB | 15 Q