3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php /* Open a test file for reading and writing */ $fp = fopen("test.txt", "rw"); $rot13_filter = stream_filter_append($fp, "string.rot13", STREAM_FILTER_WRITE); fwrite($fp, "This is "); stream_filter_remove($rot13_filter); fwrite($fp, "a test\n"); rewind($fp); fpassthru($fp); fclose($fp); ?>
Output for 7.3.0rc1 - 7.3.0rc3
Warning: fopen(): open_basedir restriction in effect. File(test.txt) is not within the allowed path(s): (/tmp:/in:/etc) in /in/Q6usD on line 3 Warning: fopen(test.txt): failed to open stream: Operation not permitted in /in/Q6usD on line 3 Warning: stream_filter_append() expects parameter 1 to be resource, bool given in /in/Q6usD on line 5 Warning: fwrite() expects parameter 1 to be resource, bool given in /in/Q6usD on line 6 Warning: stream_filter_remove() expects parameter 1 to be resource, bool given in /in/Q6usD on line 7 Warning: fwrite() expects parameter 1 to be resource, bool given in /in/Q6usD on line 8 Warning: rewind() expects parameter 1 to be resource, bool given in /in/Q6usD on line 10 Warning: fpassthru() expects parameter 1 to be resource, bool given in /in/Q6usD on line 11 Warning: fclose() expects parameter 1 to be resource, bool given in /in/Q6usD on line 12
Output for 7.3.0alpha1 - 7.3.0beta3
Warning: fopen(test.txt): failed to open stream: No such file or directory in /in/Q6usD on line 3 Warning: stream_filter_append() expects parameter 1 to be resource, bool given in /in/Q6usD on line 5 Warning: fwrite() expects parameter 1 to be resource, bool given in /in/Q6usD on line 6 Warning: stream_filter_remove() expects parameter 1 to be resource, bool given in /in/Q6usD on line 7 Warning: fwrite() expects parameter 1 to be resource, bool given in /in/Q6usD on line 8 Warning: rewind() expects parameter 1 to be resource, bool given in /in/Q6usD on line 10 Warning: fpassthru() expects parameter 1 to be resource, bool given in /in/Q6usD on line 11 Warning: fclose() expects parameter 1 to be resource, bool given in /in/Q6usD on line 12
Output for 5.6.38 - 7.2.11
Warning: fopen(): open_basedir restriction in effect. File(test.txt) is not within the allowed path(s): (/tmp:/in:/etc) in /in/Q6usD on line 3 Warning: fopen(test.txt): failed to open stream: Operation not permitted in /in/Q6usD on line 3 Warning: stream_filter_append() expects parameter 1 to be resource, boolean given in /in/Q6usD on line 5 Warning: fwrite() expects parameter 1 to be resource, boolean given in /in/Q6usD on line 6 Warning: stream_filter_remove() expects parameter 1 to be resource, boolean given in /in/Q6usD on line 7 Warning: fwrite() expects parameter 1 to be resource, boolean given in /in/Q6usD on line 8 Warning: rewind() expects parameter 1 to be resource, boolean given in /in/Q6usD on line 10 Warning: fpassthru() expects parameter 1 to be resource, boolean given in /in/Q6usD on line 11 Warning: fclose() expects parameter 1 to be resource, boolean given in /in/Q6usD on line 12