3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $var; function connectToDB($string) { return false } switch (false) { // check if we have DB credentials. case isset($DBcredentials): $DBcredentials = 'myawesomepassword';; echo "Setting var" . PHP_EOL; // connect to DB. case connectToDB($DBcredentials): // delberiate fall through, case $var is *not* caught, but we end here anyways. $var = 1; echo "Truthing Var" . PHP_EOL; case is_string($var): // delebirate fall through, case is_string($var) is *not* caught, but we end here anyways. $var = (string) $var; echo "Stringing var" . PHP_EOL; break; /* case customGuardFunction() */ default: echo "All checks passed!"; } var_dump($var);
based on rAMRi

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for Arrow functions
Parse error: syntax error, unexpected '}', expecting ';' in /in/kiAm3 on line 5

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page