3v4l.org

run code in 300+ PHP versions simultaneously
<?php session_start(); function s(){ if (isset($_SESSION['active'])) { $_SESSION['active']='30'; } else { $_SESSION['active'] = '40'; } } echo s()['active'];
Output for 8.3.0 - 8.3.4
Warning: Trying to access array offset on null in /in/bgji0 on line 13
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17
Warning: Trying to access array offset on value of type null in /in/bgji0 on line 13
Output for 7.4.0 - 7.4.33
Notice: Trying to access array offset on value of type null in /in/bgji0 on line 13
Output for 5.6.38, 7.0.0 - 7.0.32, 7.1.0 - 7.1.24, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33

preferences:
183 ms | 402 KiB | 208 Q