3v4l.org

run code in 300+ PHP versions simultaneously
<?php $testfile = dirname(__FILE__) . '/test.lock'; touch($testfile); $f1 = fopen($testfile, 'r'); echo $f1; echo var_export(flock($f1, LOCK_EX)); $f2 = fopen($testfile, 'r'); echo $f2; echo var_export(flock($f2, LOCK_EX | LOCK_NB));
Output for git.master, git.master_jit
Warning: touch(): Unable to create file /in/test.lock because Permission denied in /in/nS92E on line 4 Warning: fopen(/in/test.lock): Failed to open stream: No such file or directory in /in/nS92E on line 6 Fatal error: Uncaught TypeError: flock(): Argument #1 ($stream) must be of type resource, bool given in /in/nS92E:8 Stack trace: #0 /in/nS92E(8): flock(false, 2) #1 {main} thrown in /in/nS92E on line 8
Process exited with code 255.
Output for rfc.property-hooks
Warning: touch(): Unable to create file /in/test.lock because Permission denied in /in/nS92E on line 4 Warning: fopen(/in/test.lock): Failed to open stream: No such file or directory in /in/nS92E on line 6 Fatal error: Uncaught TypeError: flock(): Argument #1 ($stream) must be of type resource, false given in /in/nS92E:8 Stack trace: #0 /in/nS92E(8): flock(false, 2) #1 {main} thrown in /in/nS92E on line 8
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:
37.68 ms | 401 KiB | 8 Q