run code in 150+ php & hhvm versions
Bugs & Features
<?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 7.1.0
Initial: 0.364655MB Loaded string: 10.335480MB Exploded string: 27.161880MB
Output for 7.0.0 - 7.0.14
Initial: 0.364655MB Loaded string: 10.335526MB Exploded string: 27.161926MB
Output for hhvm-3.12.0
Initial: 2.000000MB Loaded string: 8.000000MB Exploded string: 16.000000MB
Output for hhvm-3.10.0
Initial: 2.000000MB Loaded string: 6.000000MB Exploded string: 14.000000MB
Output for 5.6.7 - 5.6.28
Initial: 0.212219MB Loaded string: 10.209579MB Exploded string: 31.698647MB
Output for 5.5.24 - 5.5.35
Initial: 0.212219MB Loaded string: 10.209534MB Exploded string: 31.698769MB
Output for 5.4.10 - 5.4.45
Initial: 0.212158MB Loaded string: 10.209473MB Exploded string: 31.699272MB
Output for 5.4.0 - 5.4.9
Initial: 0.211655MB Loaded string: 10.208969MB Exploded string: 31.698654MB
Output for 5.3.11 - 5.3.29
Initial: 0.598793MB Loaded string: 10.594910MB Exploded string: 32.084351MB
Output for 5.3.4 - 5.3.10
Initial: 0.598503MB Loaded string: 10.594620MB Exploded string: 32.084030MB
Output for 5.2.15 - 5.2.17
Initial: 0.080811MB Loaded string: 10.077156MB Exploded string: 31.009628MB