3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function __construct($p) { echo "Ignoring param\n"; } } $o1 = new Test($a=8); // global $a var_dump($GLOBALS['a'],$o1); // why? class Test2 {} $o1 = new Test2($b=8); var_dump($GLOBALS['b'],$o1); // why?
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vOFic
function name:  (null)
number of ops:  23
compiled vars:  !0 = $o1, !1 = $a, !2 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $3      'Test'
          1        ASSIGN                                           ~4      !1, 8
          2        SEND_VAL_EX                                              ~4
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $3
    9     5        INIT_FCALL                                               'var_dump'
          6        FETCH_R                      global              ~7      'GLOBALS'
          7        FETCH_DIM_R                                      ~8      ~7, 'a'
          8        SEND_VAL                                                 ~8
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
   12    11        NEW                                              $10     'Test2'
         12        ASSIGN                                           ~11     !2, 8
         13        SEND_VAL_EX                                              ~11
         14        DO_FCALL                                      0          
         15        ASSIGN                                                   !0, $10
   13    16        INIT_FCALL                                               'var_dump'
         17        FETCH_R                      global              ~14     'GLOBALS'
         18        FETCH_DIM_R                                      ~15     ~14, 'b'
         19        SEND_VAL                                                 ~15
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Class Test:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vOFic
function name:  __construct
number of ops:  3
compiled vars:  !0 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        ECHO                                                     'Ignoring+param%0A'
    6     2      > RETURN                                                   null

End of function __construct

End of class Test.

Class Test2: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.43 ms | 1395 KiB | 15 Q