3v4l.org

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

Class a:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/NtvD4
function name:  __construct
number of ops:  17
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV_INIT                                        !0      0
    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        IS_NOT_IDENTICAL                                         !0, 0
          8      > JMPZ                                                     ~5, ->13
   12     9    >   NEW                                              $7      'a'
         10        DO_FCALL                                      0          
         11        ASSIGN_OBJ                                               'this'
         12        OP_DATA                                                  $7
   14    13    >   FETCH_OBJ_R                                      ~9      'a'
         14        CONCAT                                           ~10     ~9, '%0A'
         15        ECHO                                                     ~10
   15    16      > RETURN                                                   null

End of function __construct

End of class a.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.26 ms | 1394 KiB | 13 Q