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; $b = &$a; $o = new Test($b); var_dump($b == $GLOBALS['b']);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rW49N
function name:  (null)
number of ops:  13
compiled vars:  !0 = $a, !1 = $b, !2 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, 8
    9     1        ASSIGN_REF                                               !1, !0
   10     2        NEW                                              $5      'Test'
          3        SEND_VAR_EX                                              !1
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !2, $5
   11     6        INIT_FCALL                                               'var_dump'
          7        FETCH_R                      global              ~8      'GLOBALS'
          8        FETCH_DIM_R                                      ~9      ~8, 'b'
          9        IS_EQUAL                                         ~10     !1, ~9
         10        SEND_VAL                                                 ~10
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Class Test:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rW49N
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:
159.62 ms | 1386 KiB | 15 Q