3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function __construct(&$x){ ++$x; echo "You sent me $x\n"; } } $a = 8; $o = new Test($b = &$a); var_dump($b,$b == $GLOBALS['b']);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fmlTY
function name:  (null)
number of ops:  14
compiled vars:  !0 = $a, !1 = $o, !2 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, 8
    9     1        NEW                                              $4      'Test'
          2        ASSIGN_REF                                       $5      !2, !0
          3        SEND_VAR_NO_REF_EX                                       $5
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $4
   10     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !2
          8        FETCH_R                      global              ~8      'GLOBALS'
          9        FETCH_DIM_R                                      ~9      ~8, 'b'
         10        IS_EQUAL                                         ~10     !2, ~9
         11        SEND_VAL                                                 ~10
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Class Test:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fmlTY
function name:  __construct
number of ops:  7
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        PRE_INC                                                  !0
    5     2        ROPE_INIT                                     3  ~3      'You+sent+me+'
          3        ROPE_ADD                                      1  ~3      ~3, !0
          4        ROPE_END                                      2  ~2      ~3, '%0A'
          5        ECHO                                                     ~2
    6     6      > RETURN                                                   null

End of function __construct

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.67 ms | 1395 KiB | 15 Q