3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { public $q = "QQQ"; } class B { public $p = "PPP"; } $a = "q"; $vari = "aa"; $oa = new A(); echo $oa->$$a;
based on 03ekF
Output for 7.1.0 - 7.2.0
Notice: Undefined variable: q in /in/8s1q4 on line 16 Notice: Undefined property: A::$ in /in/8s1q4 on line 16
Output for 7.0.0 - 7.0.20
Notice: Undefined variable: q in /in/8s1q4 on line 16 Fatal error: Uncaught Error: Cannot access empty property in /in/8s1q4:16 Stack trace: #0 {main} thrown in /in/8s1q4 on line 16
Process exited with code 255.
Output for 5.3.19 - 5.6.28
Notice: Undefined variable: q in /in/8s1q4 on line 16 Fatal error: Cannot access empty property in /in/8s1q4 on line 16
Process exited with code 255.