3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.45 ms | 939 KiB | 16 Q