3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); $foo = (object)[false]; $foo->{0} = true; $foo = (array)$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/Jl3H8
function name:  (null)
number of ops:  11
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                                               'json_encode'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $6      
          9        ECHO                                                     $6
         10      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.14 ms | 1394 KiB | 15 Q