3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x=(object) array('20'=>'abc'); echo $x->{20}; echo "\n"; $GLOBALS[20] = 'bbq'; echo ${20};
Output for 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
abc bbq
Output for 8.0.0 - 8.0.30
abc Warning: Undefined variable $20 in /in/OZ291 on line 10
Output for 7.3.0 - 7.3.31, 7.3.33, 7.4.0 - 7.4.25, 7.4.27 - 7.4.33
abc Notice: Undefined variable: 20 in /in/OZ291 on line 10
Output for 7.3.32, 7.4.26
abc

preferences:
149.49 ms | 401 KiB | 152 Q