3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $boo = 1; $_SESSION['boo']='$boo'; $boo = 2; echo 'boo = ', $boo, ' '; echo '$_SESSION[boo] = ', $$_SESSION[boo];
based on jPhkK
Output for 7.2.0
boo = 2 $_SESSION[boo] = Warning: Use of undefined constant boo - assumed 'boo' (this will throw an Error in a future version of PHP) in /in/ogqKr on line 6 Notice: Array to string conversion in /in/ogqKr on line 6 Notice: Undefined variable: Array in /in/ogqKr on line 6
Output for 7.0.0 - 7.1.10
boo = 2 $_SESSION[boo] = Notice: Use of undefined constant boo - assumed 'boo' in /in/ogqKr on line 6 Notice: Array to string conversion in /in/ogqKr on line 6 Notice: Undefined variable: Array in /in/ogqKr on line 6
Output for 5.3.18 - 5.6.28
boo = 2 $_SESSION[boo] = Notice: Use of undefined constant boo - assumed 'boo' in /in/ogqKr on line 6 Notice: Undefined variable: $boo in /in/ogqKr on line 6