3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $path = 'test.tmp'; file_put_contents("abcd", $path); var_dump(mime_content_type($path) === 'text/plain'); file_put_contents("abc", $path); var_dump(mime_content_type($path) === 'text/plain');
based on cRDDC
Output for 5.3.6 - 7.2.0
Warning: file_put_contents(abcd): failed to open stream: Permission denied in /in/s81lN on line 4 Warning: mime_content_type(test.tmp): failed to open stream: No such file or directory in /in/s81lN on line 5 bool(false) Warning: file_put_contents(abc): failed to open stream: Permission denied in /in/s81lN on line 7 Warning: mime_content_type(test.tmp): failed to open stream: No such file or directory in /in/s81lN on line 8 bool(false)
Output for 5.3.0 - 5.3.5
Warning: file_put_contents(abcd): failed to open stream: Permission denied in /in/s81lN on line 4 Warning: mime_content_type(): File or path not found 'test.tmp' in /in/s81lN on line 5 bool(false) Warning: file_put_contents(abc): failed to open stream: Permission denied in /in/s81lN on line 7 Warning: mime_content_type(): File or path not found 'test.tmp' in /in/s81lN on line 8 bool(false)
Output for 5.0.0 - 5.2.17
Warning: file_put_contents(abcd): failed to open stream: Permission denied in /in/s81lN on line 4 Fatal error: Call to undefined function mime_content_type() in /in/s81lN on line 5
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: file_put_contents() in /in/s81lN on line 4
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: file_put_contents() in /in/s81lN on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: file_put_contents() in /in/s81lN on line 4