3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php define('EOL','<br>'); $data='a=1&b=2&c=3'; echo 'global scope',EOL; echo 'parse_data(): ',$data,EOL; parse_str($data); if(isset($b)) { echo 'isset b='.$b,EOL; } else { echo 'no b='.$b,EOL; } echo EOL; echo 'within function',EOL; testme(); function testme() { $data='a=1&b=2&c=3'; echo 'parse_data(): ',$data,EOL; parse_str($data); //echo print_r($b,1); if(isset($b)) { echo 'isset b='.$b,EOL; } else { echo 'notset b='.$b,EOL; } if(isset($b)) { echo 'isset b='.$b,EOL; } else { echo 'no b='.$b,EOL; } }
Output for 7.2.0
global scope<br>parse_data(): a=1&b=2&c=3<br> Deprecated: parse_str(): Calling parse_str() without the result argument is deprecated in /in/aWckH on line 8 isset b=2<br><br>within function<br>parse_data(): a=1&b=2&c=3<br> Deprecated: parse_str(): Calling parse_str() without the result argument is deprecated in /in/aWckH on line 22 isset b=2<br>isset b=2<br>
Output for 4.3.0 - 7.1.10
global scope<br>parse_data(): a=1&b=2&c=3<br>isset b=2<br><br>within function<br>parse_data(): a=1&b=2&c=3<br>isset b=2<br>isset b=2<br>