3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); var_dump([ 0 == false, '0' == true, 'false' == true ]); echo PHP_EOL, str_repeat('#', 80), PHP_EOL; var_dump([ 0 === false, '0' === true, 'false' === true ]); echo PHP_EOL, str_repeat('#', 80), PHP_EOL; function foo(string $bar) { var_dump($bar); } foo(false);
Output for git.master, git.master_jit
array(3) { [0]=> bool(true) [1]=> bool(false) [2]=> bool(true) } ################################################################################ array(3) { [0]=> bool(false) [1]=> bool(false) [2]=> bool(false) } ################################################################################ Fatal error: Uncaught TypeError: foo(): Argument #1 ($bar) must be of type string, bool given, called in /in/SJKe1 on line 24 and defined in /in/SJKe1:20 Stack trace: #0 /in/SJKe1(24): foo(false) #1 {main} thrown in /in/SJKe1 on line 20
Process exited with code 255.
Output for rfc.property-hooks
array(3) { [0]=> bool(true) [1]=> bool(false) [2]=> bool(true) } ################################################################################ array(3) { [0]=> bool(false) [1]=> bool(false) [2]=> bool(false) } ################################################################################ Fatal error: Uncaught TypeError: foo(): Argument #1 ($bar) must be of type string, false given, called in /in/SJKe1 on line 24 and defined in /in/SJKe1:20 Stack trace: #0 /in/SJKe1(24): foo(false) #1 {main} thrown in /in/SJKe1 on line 20
Process exited with code 255.

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:
32.4 ms | 408 KiB | 5 Q