3v4l.org

run code in 300+ PHP versions simultaneously
<?php function check($players1, $confirm1, $players2, $confirm2){ if ($players1 === NULL and $confirm1 === 0) { return 1; } elseif ($players1 !== NULL and $confirm1 === 1 and $players2 === NULL and $confirm2 === 0) { return 2; } else { return 3; } } $tests = [ [null, 0, null, null], [1,1, null, 0], [1, null, null, null], [1,1,1,1], ]; foreach($tests as $test){ var_dump(check(...$test)); }
Output for git.master, git.master_jit, rfc.property-hooks
int(1) int(2) int(3) int(3)

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:
37.36 ms | 401 KiB | 8 Q