3v4l.org

run code in 300+ PHP versions simultaneously
<?php ini_set('memory_limit', -1); $a = range(0, 20000000); $b = array_map(function($z){ return $z*2; }, $a);
Output for 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
Fatal error: Out of memory (allocated 2097152 bytes) (tried to allocate 536870920 bytes) in /in/gRUHC on line 3 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 7.0.20, 7.1.5 - 7.1.20, 7.2.0 - 7.2.33, 7.3.12 - 7.3.33, 7.4.0 - 7.4.4, 7.4.6 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28
Fatal error: Out of memory (allocated 2097152) (tried to allocate 1073741832 bytes) in /in/gRUHC on line 3 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 7.4.5
Output for 5.4.15 - 5.4.23
Fatal error: Out of memory (allocated 260308992) (tried to allocate 32 bytes) in /in/gRUHC on line 3
Process exited with code 255.
Output for 5.4.0 - 5.4.14
Fatal error: Out of memory (allocated 260571136) (tried to allocate 32 bytes) in /in/gRUHC on line 3
Process exited with code 255.
Output for 5.3.6 - 5.3.28
Fatal error: Out of memory (allocated 265551872) (tried to allocate 32 bytes) in /in/gRUHC on line 3
Process exited with code 255.
Output for 5.3.5
Fatal error: Out of memory (allocated 203423744) (tried to allocate 32 bytes) in /in/gRUHC on line 3
Process exited with code 255.

preferences:
160.52 ms | 401 KiB | 199 Q