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 '-'; echo fread($b, 6);
Output for 5.1.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
aaa-bbb
Output for 4.3.3 - 5.1.3
Warning: fopen(php://temp): failed to open stream: Success in /in/YklhS on line 3 Warning: fopen(php://temp): failed to open stream: Success in /in/YklhS on line 4 Warning: fwrite(): supplied argument is not a valid stream resource in /in/YklhS on line 5 Warning: fwrite(): supplied argument is not a valid stream resource in /in/YklhS on line 6 Warning: rewind(): supplied argument is not a valid stream resource in /in/YklhS on line 7 Warning: rewind(): supplied argument is not a valid stream resource in /in/YklhS on line 8 Warning: fread(): supplied argument is not a valid stream resource in /in/YklhS on line 9 - Warning: fread(): supplied argument is not a valid stream resource in /in/YklhS on line 11
Output for 4.3.2
Warning: fopen(php://temp): failed to open stream: Inappropriate ioctl for device in /in/YklhS on line 3 Warning: fopen(php://temp): failed to open stream: Inappropriate ioctl for device in /in/YklhS on line 4 Warning: fwrite(): supplied argument is not a valid stream resource in /in/YklhS on line 5 Warning: fwrite(): supplied argument is not a valid stream resource in /in/YklhS on line 6 Warning: rewind(): supplied argument is not a valid stream resource in /in/YklhS on line 7 Warning: rewind(): supplied argument is not a valid stream resource in /in/YklhS on line 8 Warning: fread(): supplied argument is not a valid stream resource in /in/YklhS on line 9 - Warning: fread(): supplied argument is not a valid stream resource in /in/YklhS on line 11
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/YklhS on line 3 Warning: fopen(php://temp) [http://www.php.net/function.fopen]: failed to create stream: Inappropriate ioctl for device in /in/YklhS on line 4 Warning: fwrite(): supplied argument is not a valid stream resource in /in/YklhS on line 5 Warning: fwrite(): supplied argument is not a valid stream resource in /in/YklhS on line 6 Warning: rewind(): supplied argument is not a valid stream resource in /in/YklhS on line 7 Warning: rewind(): supplied argument is not a valid stream resource in /in/YklhS on line 8 Warning: fread(): supplied argument is not a valid stream resource in /in/YklhS on line 9 - Warning: fread(): supplied argument is not a valid stream resource in /in/YklhS on line 11