3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $s = fopen('php://memory', 'r+'); fflush($s); var_dump(fflush($s)); $s = fopen('php://memory', 'r'); var_dump(fflush($s));
based on abrAj
Output for 5.1.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
bool(true) bool(true)
Output for 5.0.0 - 5.1.3
Warning: fopen(php://memory): failed to open stream: Inappropriate ioctl for device in /in/DNnX4 on line 3 Warning: fflush(): supplied argument is not a valid stream resource in /in/DNnX4 on line 4 Warning: fflush(): supplied argument is not a valid stream resource in /in/DNnX4 on line 5 bool(false) Warning: fopen(php://memory): failed to open stream: Inappropriate ioctl for device in /in/DNnX4 on line 6 Warning: fflush(): supplied argument is not a valid stream resource in /in/DNnX4 on line 7 bool(false)
Output for 4.3.5 - 4.4.9
Warning: fopen(php://memory): failed to open stream: Success in /in/DNnX4 on line 3 Warning: fflush(): supplied argument is not a valid stream resource in /in/DNnX4 on line 4 Warning: fflush(): supplied argument is not a valid stream resource in /in/DNnX4 on line 5 bool(false) Warning: fopen(php://memory): failed to open stream: Success in /in/DNnX4 on line 6 Warning: fflush(): supplied argument is not a valid stream resource in /in/DNnX4 on line 7 bool(false)
Output for 4.3.3 - 4.3.4
Warning: fopen(php://memory): failed to open stream: Success in /in/DNnX4 on line 3 Warning: fflush(): supplied argument is not a valid stream resource in /in/DNnX4 on line 4 Warning: fflush(): supplied argument is not a valid stream resource in /in/DNnX4 on line 5 NULL Warning: fopen(php://memory): failed to open stream: Success in /in/DNnX4 on line 6 Warning: fflush(): supplied argument is not a valid stream resource in /in/DNnX4 on line 7 NULL
Output for 4.3.2
Warning: fopen(php://memory): failed to open stream: Inappropriate ioctl for device in /in/DNnX4 on line 3 Warning: fflush(): supplied argument is not a valid stream resource in /in/DNnX4 on line 4 Warning: fflush(): supplied argument is not a valid stream resource in /in/DNnX4 on line 5 NULL Warning: fopen(php://memory): failed to open stream: Inappropriate ioctl for device in /in/DNnX4 on line 6 Warning: fflush(): supplied argument is not a valid stream resource in /in/DNnX4 on line 7 NULL
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/DNnX4 on line 3 Warning: fflush(): supplied argument is not a valid stream resource in /in/DNnX4 on line 4 Warning: fflush(): supplied argument is not a valid stream resource in /in/DNnX4 on line 5 NULL Warning: fopen(php://memory) [http://www.php.net/function.fopen]: failed to create stream: Inappropriate ioctl for device in /in/DNnX4 on line 6 Warning: fflush(): supplied argument is not a valid stream resource in /in/DNnX4 on line 7 NULL