3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = '{"":{}}'; $b = json_encode(json_decode($a, true)); $c = json_encode(json_decode($a, false)); echo " Want $a Get $b or $c ";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PqoH9
function name:  (null)
number of ops:  26
compiled vars:  !0 = $a, !1 = $b, !2 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%7B%22%22%3A%7B%7D%7D'
    3     1        INIT_FCALL                                               'json_encode'
          2        INIT_FCALL                                               'json_decode'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 <true>
          5        DO_ICALL                                         $4      
          6        SEND_VAR                                                 $4
          7        DO_ICALL                                         $5      
          8        ASSIGN                                                   !1, $5
    4     9        INIT_FCALL                                               'json_encode'
         10        INIT_FCALL                                               'json_decode'
         11        SEND_VAR                                                 !0
         12        SEND_VAL                                                 <false>
         13        DO_ICALL                                         $7      
         14        SEND_VAR                                                 $7
         15        DO_ICALL                                         $8      
         16        ASSIGN                                                   !2, $8
    6    17        ROPE_INIT                                     7  ~11     '%0AWant+'
    7    18        ROPE_ADD                                      1  ~11     ~11, !0
         19        ROPE_ADD                                      2  ~11     ~11, '%0AGet++'
    8    20        ROPE_ADD                                      3  ~11     ~11, !1
         21        ROPE_ADD                                      4  ~11     ~11, '%0Aor+++'
    9    22        ROPE_ADD                                      5  ~11     ~11, !2
         23        ROPE_END                                      6  ~10     ~11, '%0A'
         24        ECHO                                                     ~10
   10    25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.67 ms | 1395 KiB | 17 Q