3v4l.org

run code in 300+ PHP versions simultaneously
<?php $cities = array( 'name' => array("London","Brighton"), 'population' => array("12000000","500000") ); $array=array(); $array['firstname']="John"; $array['lastname']="Doe"; $array['cities'][] = $cities; echo json_encode($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KeZOh
function name:  (null)
number of ops:  14
compiled vars:  !0 = $cities, !1 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    7     1        ASSIGN                                                   !1, <array>
    8     2        ASSIGN_DIM                                               !1, 'firstname'
          3        OP_DATA                                                  'John'
    9     4        ASSIGN_DIM                                               !1, 'lastname'
          5        OP_DATA                                                  'Doe'
   10     6        FETCH_DIM_W                                      $6      !1, 'cities'
          7        ASSIGN_DIM                                               $6
          8        OP_DATA                                                  !0
   11     9        INIT_FCALL                                               'json_encode'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $8      
         12        ECHO                                                     $8
         13      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.95 ms | 1009 KiB | 14 Q