3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $string = base64_decode('R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs='); $resource = fopen('php://tmp', 'w'); fwrite($resource, $string); fclose($resource); var_dump(mime_content_type('data://text/plain;base64,' . base64_encode($string)));
based on nsNGN
Output for 5.3.6 - 5.6.28, 7.0.0 - 7.1.0
Warning: fopen(): Invalid php:// URL specified in /in/1inZs on line 4 Warning: fopen(php://tmp): failed to open stream: operation failed in /in/1inZs on line 4 Warning: fwrite() expects parameter 1 to be resource, boolean given in /in/1inZs on line 5 Warning: fclose() expects parameter 1 to be resource, boolean given in /in/1inZs on line 6 string(9) "image/gif"
Output for hhvm-3.12.0
Warning: fwrite() expects parameter 1 to be resource, boolean given in /in/1inZs on line 5 Warning: fclose() expects parameter 1 to be resource, boolean given in /in/1inZs on line 6 Warning: Failed identify data 0:(null) in /in/1inZs on line 8 string(0) ""
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.3.0 - 5.3.5
Warning: fopen(): Invalid php:// URL specified in /in/1inZs on line 4 Warning: fopen(php://tmp): failed to open stream: operation failed in /in/1inZs on line 4 Warning: fwrite() expects parameter 1 to be resource, boolean given in /in/1inZs on line 5 Warning: fclose() expects parameter 1 to be resource, boolean given in /in/1inZs on line 6 Warning: mime_content_type(): File or path not found 'data://text/plain;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=' in /in/1inZs on line 8 bool(false)
Output for 5.2.7 - 5.2.17
Warning: fopen(): Invalid php:// URL specified in /in/1inZs on line 4 Warning: fopen(php://tmp): failed to open stream: operation failed in /in/1inZs on line 4 Warning: fwrite(): supplied argument is not a valid stream resource in /in/1inZs on line 5 Warning: fclose(): supplied argument is not a valid stream resource in /in/1inZs on line 6 Fatal error: Call to undefined function mime_content_type() in /in/1inZs on line 8
Process exited with code 255.
Output for 5.2.1 - 5.2.6
Warning: fopen(): Invalid php:// URL specified in /in/1inZs on line 4 Warning: fopen(php://tmp): failed to open stream: Inappropriate ioctl for device in /in/1inZs on line 4 Warning: fwrite(): supplied argument is not a valid stream resource in /in/1inZs on line 5 Warning: fclose(): supplied argument is not a valid stream resource in /in/1inZs on line 6 Fatal error: Call to undefined function mime_content_type() in /in/1inZs on line 8
Process exited with code 255.
Output for 5.0.0 - 5.2.0
Warning: fopen(php://tmp): failed to open stream: Inappropriate ioctl for device in /in/1inZs on line 4 Warning: fwrite(): supplied argument is not a valid stream resource in /in/1inZs on line 5 Warning: fclose(): supplied argument is not a valid stream resource in /in/1inZs on line 6 Fatal error: Call to undefined function mime_content_type() in /in/1inZs on line 8
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Warning: fopen(php://tmp): failed to open stream: Success in /in/1inZs on line 4 Warning: fwrite(): supplied argument is not a valid stream resource in /in/1inZs on line 5 Warning: fclose(): supplied argument is not a valid stream resource in /in/1inZs on line 6 Fatal error: Call to undefined function: mime_content_type() in /in/1inZs on line 8
Process exited with code 255.
Output for 4.3.3 - 4.4.4
Warning: fopen(php://tmp): failed to open stream: Success in /in/1inZs on line 4 Warning: fwrite(): supplied argument is not a valid stream resource in /in/1inZs on line 5 Warning: fclose(): supplied argument is not a valid stream resource in /in/1inZs on line 6 Fatal error: Call to undefined function: mime_content_type() in /in/1inZs on line 8
Process exited with code 255.
Output for 4.3.2
Warning: fopen(php://tmp): failed to open stream: Inappropriate ioctl for device in /in/1inZs on line 4 Warning: fwrite(): supplied argument is not a valid stream resource in /in/1inZs on line 5 Warning: fclose(): supplied argument is not a valid stream resource in /in/1inZs on line 6 Fatal error: Call to undefined function: mime_content_type() in /in/1inZs on line 8
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: fopen(php://tmp) [http://www.php.net/function.fopen]: failed to create stream: Inappropriate ioctl for device in /in/1inZs on line 4 Warning: fwrite(): supplied argument is not a valid stream resource in /in/1inZs on line 5 Warning: fclose(): supplied argument is not a valid stream resource in /in/1inZs on line 6 Fatal error: Call to undefined function: mime_content_type() in /in/1inZs on line 8