3v4l.org

run code in 300+ PHP versions simultaneously
<?php $cars = Array ( '0' => Array ( 'category' => 'Most Selling', 'title' => 'BMW', 'price' => 20000 ), '1' => Array ( 'category' => 'Most Selling', 'title' => 'Jeep', 'price' => 15000 ), '2' => Array ( 'category' => 'Most Selling', 'title' => 'Lexus', 'price' => 18000 ) ); $data = [ 'model' => 'new', 'company' => implode(', ',array_column($cars, 'title')) ]; echo $json = json_encode($data);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9IrW8
function name:  (null)
number of ops:  18
compiled vars:  !0 = $cars, !1 = $data, !2 = $json
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   21     1        INIT_ARRAY                                       ~4      'new', 'model'
   22     2        INIT_FCALL                                               'implode'
          3        SEND_VAL                                                 '%2C+'
          4        INIT_FCALL                                               'array_column'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 'title'
          7        DO_ICALL                                         $5      
          8        SEND_VAR                                                 $5
          9        DO_ICALL                                         $6      
         10        ADD_ARRAY_ELEMENT                                ~4      $6, 'company'
   20    11        ASSIGN                                                   !1, ~4
   24    12        INIT_FCALL                                               'json_encode'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                         $8      
         15        ASSIGN                                           ~9      !2, $8
         16        ECHO                                                     ~9
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.96 ms | 1001 KiB | 16 Q