3v4l.org

run code in 300+ PHP versions simultaneously
<?php function check($value) { if ($value != "") { echo 'is not an empty string'; } else if ($value == '') { echo 'is an empty string'; } else { echo 'SOMETHING ELSE'; } } foreach(array( '', 0, false, true, null, -1, array(), 1, '0', '1' ) as $value) { echo trim(var_export($value, true)), ': ', check($value), "\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
'': is an empty string 0: is not an empty string false: is an empty string true: is not an empty string NULL: is an empty string -1: is not an empty string array ( ): is not an empty string 1: is not an empty string '0': is not an empty string '1': is not an empty string

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

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


preferences:
34.27 ms | 402 KiB | 8 Q