3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
299.33 ms | 1394 KiB | 18 Q