3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = fopen('php://temp', 'r+'); $b = fopen('php://temp', 'r+'); fwrite($a, 'aaa'); fwrite($b, 'bbb'); rewind($a); rewind($b); echo fread($a, 6); echo fread($b, 6);
Output for 5.1.4 - 7.1.0
aaabbb
Output for 4.3.3 - 5.1.3
Warning: fopen(php://temp): failed to open stream: Success in /in/8XjP5 on line 3 Warning: fopen(php://temp): failed to open stream: Success in /in/8XjP5 on line 4 Warning: fwrite(): supplied argument is not a valid stream resource in /in/8XjP5 on line 5 Warning: fwrite(): supplied argument is not a valid stream resource in /in/8XjP5 on line 6 Warning: rewind(): supplied argument is not a valid stream resource in /in/8XjP5 on line 7 Warning: rewind(): supplied argument is not a valid stream resource in /in/8XjP5 on line 8 Warning: fread(): supplied argument is not a valid stream resource in /in/8XjP5 on line 9 Warning: fread(): supplied argument is not a valid stream resource in /in/8XjP5 on line 10
Output for 4.3.2
Warning: fopen(php://temp): failed to open stream: Inappropriate ioctl for device in /in/8XjP5 on line 3 Warning: fopen(php://temp): failed to open stream: Inappropriate ioctl for device in /in/8XjP5 on line 4 Warning: fwrite(): supplied argument is not a valid stream resource in /in/8XjP5 on line 5 Warning: fwrite(): supplied argument is not a valid stream resource in /in/8XjP5 on line 6 Warning: rewind(): supplied argument is not a valid stream resource in /in/8XjP5 on line 7 Warning: rewind(): supplied argument is not a valid stream resource in /in/8XjP5 on line 8 Warning: fread(): supplied argument is not a valid stream resource in /in/8XjP5 on line 9 Warning: fread(): supplied argument is not a valid stream resource in /in/8XjP5 on line 10
Output for 4.3.0 - 4.3.1
Warning: fopen(php://temp) [http://www.php.net/function.fopen]: failed to create stream: Inappropriate ioctl for device in /in/8XjP5 on line 3 Warning: fopen(php://temp) [http://www.php.net/function.fopen]: failed to create stream: Inappropriate ioctl for device in /in/8XjP5 on line 4 Warning: fwrite(): supplied argument is not a valid stream resource in /in/8XjP5 on line 5 Warning: fwrite(): supplied argument is not a valid stream resource in /in/8XjP5 on line 6 Warning: rewind(): supplied argument is not a valid stream resource in /in/8XjP5 on line 7 Warning: rewind(): supplied argument is not a valid stream resource in /in/8XjP5 on line 8 Warning: fread(): supplied argument is not a valid stream resource in /in/8XjP5 on line 9 Warning: fread(): supplied argument is not a valid stream resource in /in/8XjP5 on line 10