3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public $x = 1; // access modifiers effect property/method visibility not scope protected $y = 2; private $z = 3; } $o = new Test(); function TryIt(){ class Test { public $x = 24; // access modifiers effect property/method visibility not scope protected $y = 28; private $z = 30; } $f = new Test(); echo $f->x,"\n"; } TryIt(); var_dump($GLOBALS);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SOOLY
function name:  (null)
number of ops:  10
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $1      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   18     3        INIT_FCALL                                               'tryit'
          4        DO_FCALL                                      0          
   20     5        INIT_FCALL                                               'var_dump'
          6        FETCH_R                      global              ~5      'GLOBALS'
          7        SEND_VAL                                                 ~5
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function tryit:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SOOLY
function name:  TryIt
number of ops:  8
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   DECLARE_CLASS                                            'test'
   15     1        NEW                                              $1      'Test'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   16     4        FETCH_OBJ_R                                      ~4      !0, 'x'
          5        ECHO                                                     ~4
          6        ECHO                                                     '%0A'
   17     7      > RETURN                                                   null

End of function tryit

Class Test: [no user functions]
Class Test: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.25 ms | 1397 KiB | 16 Q