3v4l.org

run code in 300+ PHP versions simultaneously
<?php $o = new class extends stdClass { private $ccc = 222; }; $o->aaa = 1; $o->bbb = false; $a = [$o]; var_dump(json_encode($a));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0k5XC
function name:  (null)
number of ops:  17
compiled vars:  !0 = $o, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_ANON_CLASS                               <true>  'stdclass'
          1        NEW                                              $3      $2
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
    6     4        ASSIGN_OBJ                                               !0, 'aaa'
          5        OP_DATA                                                  1
    7     6        ASSIGN_OBJ                                               !0, 'bbb'
          7        OP_DATA                                                  <false>
    8     8        INIT_ARRAY                                       ~8      !0
          9        ASSIGN                                                   !1, ~8
    9    10        INIT_FCALL                                               'var_dump'
         11        INIT_FCALL                                               'json_encode'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $10     
         14        SEND_VAR                                                 $10
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Class stdClass@anonymous: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.02 ms | 1394 KiB | 17 Q