3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $fname = 'graci.txt'; $fp = fopen('graci.txt', file_exists($fname) ? 'a+' : 'w+');
Output for 5.2.3 - 7.2.0
Warning: fopen(graci.txt): failed to open stream: Permission denied in /in/o2ZWU on line 3
Output for 4.4.3 - 5.2.2
<br /> <b>Warning</b>: fopen(graci.txt) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: Read-only file system in <b>/in/o2ZWU</b> on line <b>3</b><br />
Output for 4.3.2 - 4.4.2
<br /> <b>Warning</b>: fopen(graci.txt): failed to open stream: Read-only file system in <b>/in/o2ZWU</b> on line <b>3</b><br />
Output for 4.3.0 - 4.3.1
<br /> <b>Warning</b>: fopen(graci.txt) [<a href='http://www.php.net/function.fopen'>function.fopen</a>]: failed to create stream: Read-only file system in <b>/in/o2ZWU</b> on line <b>3</b><br />