3v4l.org

run code in 500+ PHP versions simultaneously
<?php $foo = [ 0 => [ 'bar' => 'baz', 'qux' => [ 'x', 'y', 'y', ], ], ]; echo json_encode($foo, JSON_FORCE_OBJECT | JSON_PRETTY_PRINT), PHP_EOL, json_encode((object) $foo, JSON_PRETTY_PRINT);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2F02S
function name:  (null)
number of ops:  14
compiled vars:  !0 = $foo
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   14     1        INIT_FCALL                                                   'json_encode'
          2        SEND_VAR                                                     !0
          3        SEND_VAL                                                     144
          4        DO_ICALL                                             $2      
          5        ECHO                                                         $2
          6        ECHO                                                         '%0A'
   15     7        INIT_FCALL                                                   'json_encode'
          8        CAST                                              8  ~3      !0
          9        SEND_VAL                                                     ~3
         10        SEND_VAL                                                     128
         11        DO_ICALL                                             $4      
         12        ECHO                                                         $4
         13      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
156.22 ms | 1749 KiB | 14 Q