3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = array(new stdClass); echo json_encode($data), PHP_EOL; echo json_encode([], JSON_FORCE_OBJECT);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GPPIf
function name:  (null)
number of ops:  15
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $1      'stdClass'
          1        DO_FCALL                                      0          
          2        INIT_ARRAY                                       ~3      $1
          3        ASSIGN                                                   !0, ~3
    5     4        INIT_FCALL                                               'json_encode'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $5      
          7        ECHO                                                     $5
          8        ECHO                                                     '%0A'
    7     9        INIT_FCALL                                               'json_encode'
         10        SEND_VAL                                                 <array>
         11        SEND_VAL                                                 16
         12        DO_ICALL                                         $6      
         13        ECHO                                                     $6
         14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.73 ms | 1394 KiB | 15 Q