3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php file_put_contents("test", $x = tmpfile()); var_dump(file_get_contents($x));
based on AkVsf
Output for 7.1.25 - 7.3.1
Warning: file_put_contents(): open_basedir restriction in effect. File(test) is not within the allowed path(s): (/tmp:/in:/etc) in /in/MT9RQ on line 3 Warning: file_put_contents(test): failed to open stream: Operation not permitted in /in/MT9RQ on line 3 Warning: file_get_contents() expects parameter 1 to be a valid path, resource given in /in/MT9RQ on line 4 NULL
Output for 7.1.20
Warning: file_put_contents(): open_basedir restriction in effect. File(test) is not within the allowed path(s): (/tmp:/in) in /in/MT9RQ on line 3 Warning: file_put_contents(test): failed to open stream: Operation not permitted in /in/MT9RQ on line 3 Warning: file_get_contents() expects parameter 1 to be a valid path, resource given in /in/MT9RQ on line 4 NULL
Output for 5.4.0 - 7.1.10
Warning: file_put_contents(test): failed to open stream: Permission denied in /in/MT9RQ on line 3 Warning: file_get_contents() expects parameter 1 to be a valid path, resource given in /in/MT9RQ on line 4 NULL
Output for 5.0.0 - 5.3.29
Warning: file_put_contents(test): failed to open stream: Permission denied in /in/MT9RQ on line 3 Warning: file_get_contents() expects parameter 1 to be string, resource given in /in/MT9RQ on line 4 NULL
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: file_put_contents() in /in/MT9RQ on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: file_put_contents() in /in/MT9RQ on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: file_put_contents() in /in/MT9RQ on line 3