3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Y { private $x; function __construct(X $x) { $this->x = $x; } } class X { private $i; function __construct($i) { $this->i = $i; new Y($this); } function __destruct() { echo "I'm done {$this->i} !\n"; } } function make_x($i) { new X($i); } for ($i = 0; $i < 10; $i++) { echo "Making X $i\n"; make_x($i); }
based on DgfAd
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 5
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 5
Branch analysis from position: 16
Branch analysis from position: 5
filename:       /in/2E9hE
function name:  (null)
number of ops:  17
compiled vars:  !0 = $i
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
   8     1        NOP                                                      
  14     2        NOP                                                      
  16     3        ASSIGN                                                   !0, 0
         4      > JMP                                                      ->14
  17     5    >   ROPE_INIT                                     3  ~5      'Making+X+'
         6        ROPE_ADD                                      1  ~5      ~5, !0
         7        ROPE_END                                      2  ~4      ~5, '%0A'
         8        ECHO                                                     ~4
  18     9        INIT_FCALL                                               'make_x'
        10        SEND_VAR                                                 !0
        11        DO_FCALL                                      0          
  16    12        POST_INC                                         ~8      !0
        13        FREE                                                     ~8
        14    >   IS_SMALLER                                       ~9      !0, 10
        15      > JMPNZ                                                    ~9, ->5
  19    16    > > RETURN                                                   1

Function make_x:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2E9hE
function name:  make_x
number of ops:  6
compiled vars:  !0 = $i
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  14     0  E >   RECV                                             !0      
         1        NEW                                              $1      :-5
         2        SEND_VAR_EX                                              !0
         3        DO_FCALL                                      0          
         4        FREE                                                     $1
         5      > RETURN                                                   null

End of function make_x

Class Y:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2E9hE
function name:  __construct
number of ops:  4
compiled vars:  !0 = $x
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   5     0  E >   RECV                                             !0      
         1        ASSIGN_OBJ                                               'x'
         2        OP_DATA                                                  !0
         3      > RETURN                                                   null

End of function __construct

End of class Y.

Class X:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2E9hE
function name:  __construct
number of ops:  9
compiled vars:  !0 = $i
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  10     0  E >   RECV                                             !0      
         1        ASSIGN_OBJ                                               'i'
         2        OP_DATA                                                  !0
         3        NEW                                              $2      :-4
         4        FETCH_THIS                                       $3      
         5        SEND_VAR_EX                                              $3
         6        DO_FCALL                                      0          
         7        FREE                                                     $2
         8      > RETURN                                                   null

End of function __construct

Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2E9hE
function name:  __destruct
number of ops:  6
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  11     0  E >   FETCH_OBJ_R                                      $0      'i'
         1        ROPE_INIT                                     3  ~2      'I%27m+done+'
         2        ROPE_ADD                                      1  ~2      ~2, $0
         3        ROPE_END                                      2  ~1      ~2, '+%21%0A'
         4        ECHO                                                     ~1
         5      > RETURN                                                   null

End of function __destruct

End of class X.

Generated using Vulcan Logic Dumper, using php 7.3.0