3v4l.org

run code in 500+ PHP versions simultaneously
<?php $falses = [ 'aFalseBool' => false, 'aFalseString' => 'false', 'aNull' => null, 'zero' => 0, 'emptyString' => '', ]; $truths = [ 'aTrueBool' => true, 'aTrueString' => 'true', 'non-zero' => 42, 'anyString' => 'anystring', ]; echo "These should be false:" . PHP_EOL; foreach($falses as $key => $item) { if ((bool) $item === false) { printf("%s is false\n", $key); } else { printf("%s is not false\n", $key); } } echo "These should be true:" . PHP_EOL; foreach($truths as $key => $item) { if ((bool) $item === true) { printf("%s is true\n", $key); } else { printf("%s is not true\n", $key); } }
Output for rfc.property-hooks, git.master, git.master_jit
These should be false: aFalseBool is false aFalseString is not false aNull is false zero is false emptyString is false These should be true: aTrueBool is true aTrueString is true non-zero is true anyString is true

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:
54.29 ms | 2768 KiB | 4 Q