3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $_GET['yk'] = 'aabb'; $get = '_GET'; $tmp = $$get; echo $tmp['yk']; //right class yk{ public function get(){ $get = '_GET'; $tmp = $$get; echo $tmp['yk']; } public function get2(){ $get = 'Atmp'; $Atmp = 'bbaa'; $tmp = $$get; echo $tmp; } } $yk = new yk(); $yk->get(); //error Undefined variable: _GET
Output for 5.5.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
aabb Notice: Undefined variable: _GET in /in/Ekg1T on line 12
Output for 5.0.0 - 5.0.5, 5.1.1 - 5.4.45
aabb
Output for 5.1.0
<br /> <b>Fatal error</b>: fatal flex scanner internal error--end of buffer missed in <b>/in/Ekg1T</b> on line <b>25</b><br />
Process exited with code 255.
Output for 4.4.2 - 4.4.9
<br /> <b>Parse error</b>: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in <b>/in/Ekg1T</b> on line <b>10</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
<br /> <b>Parse error</b>: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in <b>/in/Ekg1T</b> on line <b>10</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.3.4
<br /> <b>Parse error</b>: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in <b>/in/Ekg1T</b> on line <b>10</b><br />
Process exited with code 255.