3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = (object)[false]; $foo->{0} = true; $foo = (array)$foo; $bar = json_encode($foo); // {"0":false,"0":true} var_dump(json_decode($bar));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VF4Vu
function name:  (null)
number of ops:  17
compiled vars:  !0 = $foo, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   CAST                                          8  ~2      <array>
          1        ASSIGN                                                   !0, ~2
    4     2        ASSIGN_OBJ                                               !0, '0'
          3        OP_DATA                                                  <true>
    5     4        CAST                                          7  ~5      !0
          5        ASSIGN                                                   !0, ~5
    6     6        INIT_FCALL                                               'json_encode'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $7      
          9        ASSIGN                                                   !1, $7
    7    10        INIT_FCALL                                               'var_dump'
         11        INIT_FCALL                                               'json_decode'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $9      
         14        SEND_VAR                                                 $9
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.45 ms | 1394 KiB | 19 Q