3v4l.org

run code in 300+ PHP versions simultaneously
<?php function incorrect(int $flags) { // Would work in C and other languages if ($flags & LOCK_SH) { echo "LOCK_SH\n"; } elseif($flags & LOCK_EX) { echo "LOCK_EX\n"; } elseif($flags & LOCK_UN) { echo "LOCK_UN\n"; } } function correct(int $flags) { $mode = $flags & ~LOCK_NB; if ($mode === LOCK_SH) { echo "LOCK_SH\n"; } elseif($mode === LOCK_EX) { echo "LOCK_EX\n"; } elseif($mode === LOCK_UN) { echo "LOCK_UN\n"; } } incorrect(LOCK_UN); correct(LOCK_UN);
Output for git.master, git.master_jit, rfc.property-hooks
LOCK_SH LOCK_UN

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