3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class a { function __construct($b) { var_dump($b); } } class b { function __construct() { var_dump($GLOBALS['a']); } } $a = new a(new b);
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/KPels
function name:  (null)
number of ops:  9
compiled vars:  !0 = $a
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
  11     1        NOP                                                      
  19     2        NEW                                              $3      :-6
         3        NEW                                              $4      :-4
         4        DO_FCALL                                      0          
         5        SEND_VAR_NO_REF                               0          $4
         6        DO_FCALL                                      0          
         7        ASSIGN                                                   !0, $3
         8      > RETURN                                                   1

Class a:
Function __construct:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/KPels
function name:  __construct
number of ops:  5
compiled vars:  !0 = $b
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   5     0  E >   RECV                                             !0      
   7     1        INIT_FCALL                                               'var_dump'
         2        SEND_VAR                                                 !0
         3        DO_ICALL                                                 
   8     4      > RETURN                                                   null

End of function __construct

End of class a.

Class b:
Function __construct:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/KPels
function name:  __construct
number of ops:  6
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  15     0  E >   INIT_FCALL                                               'var_dump'
         1        FETCH_R                      global              $0      'GLOBALS'
         2        FETCH_DIM_R                                      $1      $0, 'a'
         3        SEND_VAR                                                 $1
         4        DO_ICALL                                                 
  16     5      > RETURN                                                   null

End of function __construct

End of class b.

Generated using Vulcan Logic Dumper, using php 7.2.0