3v4l.org

run code in 300+ PHP versions simultaneously
<html> <head> <title>PHP Test</title> </head> <body> <?PHP $filename = 'text.txt'; $somecontent = "My name is Chukwudi and this is my contribution \n"; // Let's check if file exists and writable. IF (IS_WRITABLE($filename)) { // opening $filename. // that's where $somecontent will go when we fwrite() it. IF (!$handle = FOPEN($filename, 'a')) { PRINT "Cannot open file ($filename)"; EXIT; } // Write $somecontent to text.txt file. IF (!FWRITE($handle, $somecontent)) { PRINT "Cannot write to file ($filename)"; EXIT; } PRINT "Success, wrote ($somecontent) to file ($filename)"; FCLOSE($handle); } ELSE { PRINT "The file $filename is not writable"; } ?> </body> </html>
Output for git.master, git.master_jit, rfc.property-hooks
<html> <head> <title>PHP Test</title> </head> <body> Warning: is_writable(): open_basedir restriction in effect. File(text.txt) is not within the allowed path(s): (/tmp:/in:/etc) in /in/Zsgni on line 13 The file text.txt is not writable </body> </html>

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