3v4l.org

run code in 300+ PHP versions simultaneously
<?php file_put_contents("testfile", "testcontent"); 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: file_put_contents(): open_basedir restriction in effect. File(testfile) is not within the allowed path(s): (/tmp:/in:/etc) in /in/PFOZu on line 2 Warning: file_put_contents(testfile): Failed to open stream: Operation not permitted in /in/PFOZu on line 2 Warning: fopen(): open_basedir restriction in effect. File(testfile) is not within the allowed path(s): (/tmp:/in:/etc) in /in/PFOZu on line 5 Warning: fopen(testfile): Failed to open stream: Operation not permitted in /in/PFOZu on line 5 Fatal error: Uncaught TypeError: flock(): Argument #1 ($stream) must be of type resource, bool given in /in/PFOZu:6 Stack trace: #0 /in/PFOZu(6): flock(false, 6) #1 /in/PFOZu(11): mylock() #2 {main} thrown in /in/PFOZu on line 6
Process exited with code 255.
Output for rfc.property-hooks
Warning: file_put_contents(): open_basedir restriction in effect. File(testfile) is not within the allowed path(s): (/tmp:/in:/etc) in /in/PFOZu on line 2 Warning: file_put_contents(testfile): Failed to open stream: Operation not permitted in /in/PFOZu on line 2 Warning: fopen(): open_basedir restriction in effect. File(testfile) is not within the allowed path(s): (/tmp:/in:/etc) in /in/PFOZu on line 5 Warning: fopen(testfile): Failed to open stream: Operation not permitted in /in/PFOZu on line 5 Fatal error: Uncaught TypeError: flock(): Argument #1 ($stream) must be of type resource, false given in /in/PFOZu:6 Stack trace: #0 /in/PFOZu(6): flock(false, 6) #1 /in/PFOZu(11): mylock() #2 {main} thrown in /in/PFOZu 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:
54.9 ms | 402 KiB | 8 Q