3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { public $a = 'azerty'; function __construct($a = 'bug') { $this->this = &$this; $this->a = $a; $this->this = new a(); echo $this->a; } } $a = new a(10); echo $a->a;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NrLCK
function name:  (null)
number of ops:  7
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $1      'a'
          1        SEND_VAL_EX                                              10
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   16     4        FETCH_OBJ_R                                      ~4      !0, 'a'
          5        ECHO                                                     ~4
          6      > RETURN                                                   1

Class a:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NrLCK
function name:  __construct
number of ops:  14
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV_INIT                                        !0      'bug'
    8     1        FETCH_THIS                                       $2      
          2        MAKE_REF                                         $3      $2
          3        ASSIGN_OBJ_REF                                           'this'
          4        OP_DATA                                                  $3
    9     5        ASSIGN_OBJ                                               'a'
          6        OP_DATA                                                  !0
   10     7        NEW                                              $6      'a'
          8        DO_FCALL                                      0          
          9        ASSIGN_OBJ                                               'this'
         10        OP_DATA                                                  $6
   11    11        FETCH_OBJ_R                                      ~8      'a'
         12        ECHO                                                     ~8
   12    13      > RETURN                                                   null

End of function __construct

End of class a.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.09 ms | 1393 KiB | 13 Q