3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $n = fwrite(fopen("php://memory", "r"), "hello"); var_dump($n); $n = fwrite(tmpfile(), "hello"); var_dump($n);
Output for 5.2.7 - 7.2.0
int(0) int(5)
Output for 5.1.4 - 5.2.6
int(5) int(5)
Output for 5.0.0 - 5.1.3
Warning: fopen(php://memory): failed to open stream: Inappropriate ioctl for device in /in/HDmSb on line 2 Warning: fwrite(): supplied argument is not a valid stream resource in /in/HDmSb on line 2 bool(false) int(5)
Output for 4.3.5 - 4.4.9
Warning: fopen(php://memory): failed to open stream: Success in /in/HDmSb on line 2 Warning: fwrite(): supplied argument is not a valid stream resource in /in/HDmSb on line 2 bool(false) int(5)
Output for 4.3.3 - 4.3.4
Warning: fopen(php://memory): failed to open stream: Success in /in/HDmSb on line 2 Warning: fwrite(): supplied argument is not a valid stream resource in /in/HDmSb on line 2 NULL int(5)
Output for 4.3.2
Warning: fopen(php://memory): failed to open stream: Inappropriate ioctl for device in /in/HDmSb on line 2 Warning: fwrite(): supplied argument is not a valid stream resource in /in/HDmSb on line 2 NULL int(5)
Output for 4.3.0 - 4.3.1
Warning: fopen(php://memory) [http://www.php.net/function.fopen]: failed to create stream: Inappropriate ioctl for device in /in/HDmSb on line 2 Warning: fwrite(): supplied argument is not a valid stream resource in /in/HDmSb on line 2 NULL int(5)