3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test1 { public function __construct($z){ ++$z; echo "You sent me $z\n"; } } $c = 8; $o = new Test1($d = $c); var_dump($d,$d == $GLOBALS['d']); echo "\n"; class Test2 { public function __construct(&$x){ ++$x; echo "You sent me $x\n"; } } $a = 8; $o = new Test2($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/PdJB3
function name:  (null)
number of ops:  28
compiled vars:  !0 = $c, !1 = $o, !2 = $d, !3 = $a, !4 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, 8
    9     1        NEW                                              $6      'Test1'
          2        ASSIGN                                           ~7      !2, !0
          3        SEND_VAL_EX                                              ~7
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $6
   10     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !2
          8        FETCH_R                      global              ~10     'GLOBALS'
          9        FETCH_DIM_R                                      ~11     ~10, 'd'
         10        IS_EQUAL                                         ~12     !2, ~11
         11        SEND_VAL                                                 ~12
         12        DO_ICALL                                                 
   11    13        ECHO                                                     '%0A'
   19    14        ASSIGN                                                   !3, 8
   20    15        NEW                                              $15     'Test2'
         16        ASSIGN_REF                                       $16     !4, !3
         17        SEND_VAR_NO_REF_EX                                       $16
         18        DO_FCALL                                      0          
         19        ASSIGN                                                   !1, $15
   21    20        INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !4
         22        FETCH_R                      global              ~19     'GLOBALS'
         23        FETCH_DIM_R                                      ~20     ~19, 'b'
         24        IS_EQUAL                                         ~21     !4, ~20
         25        SEND_VAL                                                 ~21
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Class Test1:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PdJB3
function name:  __construct
number of ops:  7
compiled vars:  !0 = $z
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 Test1.

Class Test2:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PdJB3
function name:  __construct
number of ops:  7
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        PRE_INC                                                  !0
   16     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
   17     6      > RETURN                                                   null

End of function __construct

End of class Test2.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.82 ms | 1400 KiB | 15 Q