3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $fd = fopen("php://memory", "w+"); ftruncate($fd, -1);
Output for 7.1.0 - 7.3.1
Warning: ftruncate(): Negative size is not supported in /in/k720s on line 4
Output for 5.6.26 - 5.6.30, hhvm-3.10.1 - 3.17.3, 7.0.11 - 7.0.20
Output for 7.0.0 - 7.0.10
Fatal error: Out of memory (allocated 2097152) (tried to allocate 18446744073709551615 bytes) in /in/k720s on line 4 mmap() failed: [22] Invalid argument mmap() failed: [22] Invalid argument
Process exited with code 255.
Output for 5.2.3 - 5.2.17, 5.4.0 - 5.6.25
Fatal error: Out of memory (allocated 262144) (tried to allocate 18446744073709551615 bytes) in /in/k720s on line 4
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Fatal error: Out of memory (allocated 786432) (tried to allocate 18446744073709551615 bytes) in /in/k720s on line 4
Process exited with code 255.
Output for 5.2.2
Fatal error: Out of memory (allocated 262144) (tried to allocate -1 bytes) in /in/k720s on line 4
Process exited with code 255.
Output for 5.1.4 - 5.2.1
Warning: ftruncate(): Can't truncate this stream! in /in/k720s on line 4
Output for 4.3.3 - 5.1.3
Warning: fopen(php://memory): failed to open stream: Success in /in/k720s on line 3 Warning: ftruncate(): supplied argument is not a valid stream resource in /in/k720s on line 4
Output for 4.3.2
Warning: fopen(php://memory): failed to open stream: Inappropriate ioctl for device in /in/k720s on line 3 Warning: ftruncate(): supplied argument is not a valid stream resource in /in/k720s on line 4
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/k720s on line 3 Warning: ftruncate(): supplied argument is not a valid stream resource in /in/k720s on line 4