3v4l.org

run code in 300+ PHP versions simultaneously
<?php touch("testfile"); function mylock() { $F1 = fopen("testfile","r"); if (flock($F1,LOCK_EX|LOCK_NB)) echo "First lock OK\n"; else echo "First lock FAIL\n"; $F2 = fopen("testfile","r"); if (flock($F2,LOCK_EX|LOCK_NB)) echo "Second lock OK\n"; else echo "Second lock FAIL\n"; } mylock(); echo "Function returned.\n"; mylock(); unlink("testfile");
Output for git.master, git.master_jit
Warning: touch(): open_basedir restriction in effect. File(testfile) is not within the allowed path(s): (/tmp:/in:/etc) in /in/UjBS6 on line 2 Warning: fopen(): open_basedir restriction in effect. File(testfile) is not within the allowed path(s): (/tmp:/in:/etc) in /in/UjBS6 on line 5 Warning: fopen(testfile): Failed to open stream: Operation not permitted in /in/UjBS6 on line 5 Fatal error: Uncaught TypeError: flock(): Argument #1 ($stream) must be of type resource, bool given in /in/UjBS6:6 Stack trace: #0 /in/UjBS6(6): flock(false, 6) #1 /in/UjBS6(11): mylock() #2 {main} thrown in /in/UjBS6 on line 6
Process exited with code 255.
Output for rfc.property-hooks
Warning: touch(): open_basedir restriction in effect. File(testfile) is not within the allowed path(s): (/tmp:/in:/etc) in /in/UjBS6 on line 2 Warning: fopen(): open_basedir restriction in effect. File(testfile) is not within the allowed path(s): (/tmp:/in:/etc) in /in/UjBS6 on line 5 Warning: fopen(testfile): Failed to open stream: Operation not permitted in /in/UjBS6 on line 5 Fatal error: Uncaught TypeError: flock(): Argument #1 ($stream) must be of type resource, false given in /in/UjBS6:6 Stack trace: #0 /in/UjBS6(6): flock(false, 6) #1 /in/UjBS6(11): mylock() #2 {main} thrown in /in/UjBS6 on line 6
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:
77.18 ms | 401 KiB | 8 Q