3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(json_encode(array())); var_dump(json_encode((object) array())); var_dump(json_encode(new stdClass)); var_dump(json_encode(array('foo', 'bar', 'baz'))); var_dump(json_encode((object) array('foo', 'bar', 'baz'))); var_dump(json_encode(array('foo' => 'bar', 'baz'))); var_dump(json_encode(array('foo' => 'bar', 'baz' => 'bak')));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cYBju
function name:  (null)
number of ops:  47
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'json_encode'
          2        SEND_VAL                                                 <array>
          3        DO_ICALL                                         $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
    3     6        INIT_FCALL                                               'var_dump'
          7        INIT_FCALL                                               'json_encode'
          8        CAST                                          8  ~2      <array>
          9        SEND_VAL                                                 ~2
         10        DO_ICALL                                         $3      
         11        SEND_VAR                                                 $3
         12        DO_ICALL                                                 
    4    13        INIT_FCALL                                               'var_dump'
         14        INIT_FCALL                                               'json_encode'
         15        NEW                                              $5      'stdClass'
         16        DO_FCALL                                      0          
         17        SEND_VAR                                                 $5
         18        DO_ICALL                                         $7      
         19        SEND_VAR                                                 $7
         20        DO_ICALL                                                 
    5    21        INIT_FCALL                                               'var_dump'
         22        INIT_FCALL                                               'json_encode'
         23        SEND_VAL                                                 <array>
         24        DO_ICALL                                         $9      
         25        SEND_VAR                                                 $9
         26        DO_ICALL                                                 
    6    27        INIT_FCALL                                               'var_dump'
         28        INIT_FCALL                                               'json_encode'
         29        CAST                                          8  ~11     <array>
         30        SEND_VAL                                                 ~11
         31        DO_ICALL                                         $12     
         32        SEND_VAR                                                 $12
         33        DO_ICALL                                                 
    7    34        INIT_FCALL                                               'var_dump'
         35        INIT_FCALL                                               'json_encode'
         36        SEND_VAL                                                 <array>
         37        DO_ICALL                                         $14     
         38        SEND_VAR                                                 $14
         39        DO_ICALL                                                 
    8    40        INIT_FCALL                                               'var_dump'
         41        INIT_FCALL                                               'json_encode'
         42        SEND_VAL                                                 <array>
         43        DO_ICALL                                         $16     
         44        SEND_VAR                                                 $16
         45        DO_ICALL                                                 
         46      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.5 ms | 1400 KiB | 17 Q