3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $b; } class B { public $a; } $a = new A; $a->b = new B; $a->b->a = $a; echo json_encode($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kYIZ1
function name:  (null)
number of ops:  15
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   14     3        NEW                                              $5      'B'
          4        DO_FCALL                                      0          
          5        ASSIGN_OBJ                                               !0, 'b'
          6        OP_DATA                                                  $5
   15     7        FETCH_OBJ_W                                      $7      !0, 'b'
          8        ASSIGN_OBJ                                               $7, 'a'
          9        OP_DATA                                                  !0
   17    10        INIT_FCALL                                               'json_encode'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $9      
         13        ECHO                                                     $9
         14      > RETURN                                                   1

Class A: [no user functions]
Class B: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.03 ms | 1394 KiB | 15 Q