3v4l.org

run code in 300+ PHP versions simultaneously
<?php printf("Initial: %fMB\n", memory_get_peak_usage() / 1048576); $string = ''; do { $string .= 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.'; } while (strlen($string) < 10485760); printf("Loaded string: %fMB\n", memory_get_peak_usage() / 1048576); $array = explode("Lorem", $string); printf("Exploded string: %fMB\n", memory_get_peak_usage() / 1048576);
Output for 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Initial: 0.405968MB Loaded string: 10.375023MB Exploded string: 25.201393MB
Output for 8.1.0 - 8.1.1, 8.1.28
Initial: 0.406258MB Loaded string: 10.375320MB Exploded string: 27.201691MB
Output for 8.1.2 - 8.1.27
Initial: 0.406258MB Loaded string: 10.375320MB Fatal error: Out of memory (allocated 27271168) (tried to allocate 4194312 bytes) in /in/fUZ47 on line 13 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.0.0 - 8.0.30
Initial: 0.406105MB Loaded string: 10.374084MB Exploded string: 27.200455MB
Output for 7.4.0 - 7.4.33
Initial: 0.406273MB Loaded string: 10.374374MB Exploded string: 27.200745MB
Output for 7.3.0 - 7.3.33
Initial: 0.405273MB Loaded string: 10.374298MB Exploded string: 27.200668MB
Output for 7.2.0 - 7.2.33
Initial: 0.399620MB Loaded string: 10.370415MB Exploded string: 27.196785MB
Output for 7.1.0 - 7.1.33
Initial: 0.364586MB Loaded string: 10.335411MB Exploded string: 27.161812MB
Output for 7.0.0 - 7.0.33
Initial: 0.364586MB Loaded string: 10.335457MB Exploded string: 27.161858MB
Output for 5.6.0 - 5.6.40
Initial: 0.212044MB Loaded string: 10.209404MB Exploded string: 31.698479MB
Output for 5.5.0 - 5.5.38
Initial: 0.212044MB Loaded string: 10.209358MB Exploded string: 31.698540MB
Output for 5.4.10 - 5.4.45
Initial: 0.211983MB Loaded string: 10.209297MB Exploded string: 31.699066MB
Output for 5.4.0 - 5.4.9
Initial: 0.211479MB Loaded string: 10.208794MB Exploded string: 31.698540MB
Output for 5.3.11 - 5.3.29
Initial: 0.598274MB Loaded string: 10.594391MB Exploded string: 32.083778MB
Output for 5.3.0 - 5.3.10
Initial: 0.597984MB Loaded string: 10.594101MB Exploded string: 32.083519MB

preferences:
275.12 ms | 401 KiB | 407 Q