3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php echo "Initial: ".memory_get_usage()." bytes \n"; /* prints Initial: 361400 bytes */ // let's use up some memory for ($i = 0; $i < 100000; $i++) { $array []= md5($i); } // let's remove half of the array for ($i = 0; $i < 100000; $i++) { unset($array[$i]); } echo "Final: ".memory_get_usage()." bytes \n"; /* prints Final: 885912 bytes */ echo "Peak: ".memory_get_peak_usage()." bytes \n"; /* prints Peak: 13687072 bytes */ for($i=0;$i<10000000;$i++) { } $data = getrusage(); echo "User time: ". ($data['ru_utime.tv_sec'] + $data['ru_utime.tv_usec'] / 1000000); echo "System time: ". ($data['ru_stime.tv_sec'] + $data['ru_stime.tv_usec'] / 1000000);
Output for 7.1.0
Initial: 348704 bytes Final: 4547216 bytes Peak: 10947248 bytes User time: 0.223333System time: 0.006666
Output for 7.0.14
Initial: 348728 bytes Final: 4547240 bytes Peak: 10947272 bytes User time: 0.199999System time: 0.006666
Output for 7.0.3, 7.0.7
Initial: 348728 bytes Final: 4547240 bytes Peak: 10947272 bytes User time: 0.203333System time: 0.003333
Output for 7.0.6
Initial: 348728 bytes Final: 4547240 bytes Peak: 10947272 bytes User time: 0.159999System time: 0.003333
Output for 7.0.5
Initial: 348728 bytes Final: 4547240 bytes Peak: 10947272 bytes User time: 0.209999System time: 0.006666
Output for 7.0.4
Initial: 348728 bytes Final: 4547240 bytes Peak: 10947272 bytes User time: 0.196666System time: 0
Output for 7.0.2
Initial: 348728 bytes Final: 4547240 bytes Peak: 10947272 bytes User time: 0.179999System time: 0.003333
Output for 7.0.1
Initial: 348728 bytes Final: 4547240 bytes Peak: 10947272 bytes User time: 0.169999System time: 0.009999
Output for 7.0.0
Initial: 348728 bytes Final: 4547240 bytes Peak: 10947272 bytes User time: 0.209999System time: 0.003333
Output for hhvm-3.12.0
Initial: 2097152 bytes Final: 8388608 bytes Peak: 8388608 bytes User time: 0.489999System time: 0.036666
Output for hhvm-3.10.0
Initial: 2097152 bytes Final: 8388608 bytes Peak: 8388608 bytes User time: 0.546666System time: 0.019999
Output for 5.6.28
Initial: 219544 bytes Final: 1268568 bytes Peak: 20470432 bytes User time: 0.483333System time: 0.009999
Output for 5.6.21
Initial: 219544 bytes Final: 1268568 bytes Peak: 20470432 bytes User time: 0.373333System time: 0.003333
Output for 5.6.20
Initial: 219544 bytes Final: 1268568 bytes Peak: 20470432 bytes User time: 0.356666System time: 0.009999
Output for 5.6.19
Initial: 219544 bytes Final: 1268568 bytes Peak: 20470432 bytes User time: 0.343333System time: 0.023333
Output for 5.6.18
Initial: 219544 bytes Final: 1268568 bytes Peak: 20470432 bytes User time: 0.376666System time: 0.006666
Output for 5.6.17
Initial: 219544 bytes Final: 1268568 bytes Peak: 20470432 bytes User time: 0.369999System time: 0.003333
Output for 5.6.16
Initial: 219544 bytes Final: 1268568 bytes Peak: 20470432 bytes User time: 0.306666System time: 0.009999
Output for 5.6.15
Initial: 219544 bytes Final: 1268568 bytes Peak: 20470432 bytes User time: 0.359999System time: 0.003333
Output for 5.6.14
Initial: 219544 bytes Final: 1268568 bytes Peak: 20470432 bytes User time: 0.333333System time: 0.026666
Output for 5.6.13
Initial: 219544 bytes Final: 1268568 bytes Peak: 20470432 bytes User time: 0.386666System time: 0
Output for 5.6.12
Initial: 219544 bytes Final: 1268568 bytes Peak: 20470432 bytes User time: 0.369999System time: 0.006666
Output for 5.6.11
Initial: 219544 bytes Final: 1268568 bytes Peak: 20470432 bytes User time: 0.366666System time: 0.006666
Output for 5.6.10
Initial: 219544 bytes Final: 1268568 bytes Peak: 20470432 bytes User time: 0.346666System time: 0.019999
Output for 5.6.9
Initial: 219544 bytes Final: 1268568 bytes Peak: 20470432 bytes User time: 0.356666System time: 0.016666
Output for 5.6.8
Initial: 219544 bytes Final: 1268568 bytes Peak: 20470432 bytes User time: 0.353333System time: 0.009999
Output for 5.6.7
Initial: 219544 bytes Final: 1268568 bytes Peak: 20470432 bytes User time: 0.336666System time: 0.019999
Output for 5.6.6
Initial: 219544 bytes Final: 1268568 bytes Peak: 20470432 bytes User time: 0.306666System time: 0.003333
Output for 5.6.5
Initial: 219544 bytes Final: 1268568 bytes Peak: 20470432 bytes User time: 0.363333System time: 0.003333
Output for 5.6.4
Initial: 219544 bytes Final: 1268568 bytes Peak: 20470432 bytes User time: 0.343333System time: 0.013333
Output for 5.6.3
Initial: 219544 bytes Final: 1268568 bytes Peak: 20470432 bytes User time: 0.346666System time: 0.006666
Output for 5.6.2
Initial: 219544 bytes Final: 1268568 bytes Peak: 20470432 bytes User time: 0.366666System time: 0.003333
Output for 5.6.1
Initial: 219544 bytes Final: 1268568 bytes Peak: 20470432 bytes User time: 0.309999System time: 0.003333
Output for 5.6.0
Initial: 219544 bytes Final: 1268568 bytes Peak: 20470432 bytes User time: 0.359999System time: 0.013333
Output for 5.5.35
Initial: 219544 bytes Final: 1268528 bytes Peak: 20470368 bytes User time: 0.359999System time: 0.013333
Output for 5.5.34
Initial: 219544 bytes Final: 1268528 bytes Peak: 20470368 bytes User time: 0.253333System time: 0.003333
Output for 5.5.33
Initial: 219544 bytes Final: 1268528 bytes Peak: 20470368 bytes User time: 0.319999System time: 0.013333
Output for 5.5.32
Initial: 219544 bytes Final: 1268528 bytes Peak: 20470368 bytes User time: 0.353333System time: 0.013333
Output for 5.5.31
Initial: 219544 bytes Final: 1268528 bytes Peak: 20470368 bytes User time: 0.336666System time: 0.006666
Output for 5.5.30
Initial: 219544 bytes Final: 1268528 bytes Peak: 20470368 bytes User time: 0.349999System time: 0.006666
Output for 5.5.12, 5.5.29
Initial: 219544 bytes Final: 1268528 bytes Peak: 20470368 bytes User time: 0.369999System time: 0
Output for 5.5.28
Initial: 219544 bytes Final: 1268528 bytes Peak: 20470368 bytes User time: 0.349999System time: 0
Output for 5.5.27
Initial: 219544 bytes Final: 1268528 bytes Peak: 20470368 bytes User time: 0.359999System time: 0.006666
Output for 5.5.19, 5.5.26
Initial: 219544 bytes Final: 1268528 bytes Peak: 20470368 bytes User time: 0.359999System time: 0.009999
Output for 5.5.25
Initial: 219544 bytes Final: 1268528 bytes Peak: 20470368 bytes User time: 0.349999System time: 0.009999
Output for 5.5.24
Initial: 219544 bytes Final: 1268528 bytes Peak: 20470368 bytes User time: 0.353333System time: 0.006666
Output for 5.5.23
Initial: 219544 bytes Final: 1268528 bytes Peak: 20470368 bytes User time: 0.379999System time: 0.006666
Output for 5.5.22
Initial: 219544 bytes Final: 1268528 bytes Peak: 20470368 bytes User time: 0.319999System time: 0.009999
Output for 5.5.21
Initial: 219544 bytes Final: 1268528 bytes Peak: 20470368 bytes User time: 0.303333System time: 0.006666
Output for 5.5.20
Initial: 219544 bytes Final: 1268528 bytes Peak: 20470368 bytes User time: 0.349999System time: 0.019999
Output for 5.5.18
Initial: 219544 bytes Final: 1268528 bytes Peak: 20470368 bytes User time: 0.356666System time: 0.006666
Output for 5.5.16
Initial: 219544 bytes Final: 1268528 bytes Peak: 20470368 bytes User time: 0.356666System time: 0.016666
Output for 5.5.15
Initial: 219544 bytes Final: 1268528 bytes Peak: 20470368 bytes User time: 0.289999System time: 0.029999
Output for 5.5.14
Initial: 219544 bytes Final: 1268528 bytes Peak: 20470368 bytes User time: 0.346666System time: 0.009999
Output for 5.5.13
Initial: 219544 bytes Final: 1268528 bytes Peak: 20470368 bytes User time: 0.356666System time: 0.019999
Output for 5.5.11
Initial: 219544 bytes Final: 1268528 bytes Peak: 20470368 bytes User time: 0.306666System time: 0.013333
Output for 5.5.10
Initial: 219544 bytes Final: 1268528 bytes Peak: 20470368 bytes User time: 0.303333System time: 0.003333
Output for 5.5.9
Initial: 219544 bytes Final: 1268528 bytes Peak: 20470368 bytes User time: 0.253333System time: 0
Output for 5.5.8
Initial: 219544 bytes Final: 1268528 bytes Peak: 20470368 bytes User time: 0.269999System time: 0.013333
Output for 5.5.7
Initial: 219544 bytes Final: 1268528 bytes Peak: 20470368 bytes User time: 0.253333System time: 0.006666
Output for 5.5.6
Initial: 219544 bytes Final: 1268528 bytes Peak: 20470368 bytes User time: 0.259999System time: 0.006666
Output for 5.5.5
Initial: 219544 bytes Final: 1268528 bytes Peak: 20470368 bytes User time: 0.273333System time: 0.013333
Output for 5.5.4
Initial: 219544 bytes Final: 1268528 bytes Peak: 20470368 bytes User time: 0.266666System time: 0
Output for 5.5.3
Initial: 219544 bytes Final: 1268528 bytes Peak: 20470368 bytes User time: 0.336666System time: 0.016666
Output for 5.5.2
Initial: 219544 bytes Final: 1268528 bytes Peak: 20470368 bytes User time: 0.299999System time: 0.013333
Output for 5.5.1
Initial: 219544 bytes Final: 1268528 bytes Peak: 20470368 bytes User time: 0.376666System time: 0.003333
Output for 5.5.0
Initial: 219544 bytes Final: 1268528 bytes Peak: 20470368 bytes User time: 0.389999System time: 0.003333
Output for 5.4.27, 5.4.45
Initial: 220064 bytes Final: 1269064 bytes Peak: 20470752 bytes User time: 0.356666System time: 0.009999
Output for 5.4.44
Initial: 220064 bytes Final: 1269064 bytes Peak: 20470752 bytes User time: 0.326666System time: 0.003333
Output for 5.4.11, 5.4.43
Initial: 220064 bytes Final: 1269064 bytes Peak: 20470752 bytes User time: 0.393333System time: 0.013333
Output for 5.4.42
Initial: 220064 bytes Final: 1269064 bytes Peak: 20470752 bytes User time: 0.399999System time: 0.006666
Output for 5.4.40 - 5.4.41
Initial: 220064 bytes Final: 1269064 bytes Peak: 20470752 bytes User time: 0.349999System time: 0.013333
Output for 5.4.39
Initial: 220064 bytes Final: 1269064 bytes Peak: 20470752 bytes User time: 0.359999System time: 0.006666
Output for 5.4.38
Initial: 220064 bytes Final: 1269064 bytes Peak: 20470752 bytes User time: 0.349999System time: 0.016666
Output for 5.4.37
Initial: 220064 bytes Final: 1269064 bytes Peak: 20470752 bytes User time: 0.339999System time: 0.016666
Output for 5.4.36
Initial: 220064 bytes Final: 1269064 bytes Peak: 20470752 bytes User time: 0.359999System time: 0.013333
Output for 5.4.35
Initial: 220064 bytes Final: 1269064 bytes Peak: 20470752 bytes User time: 0.369999System time: 0.003333
Output for 5.4.34
Initial: 220064 bytes Final: 1269064 bytes Peak: 20470752 bytes User time: 0.329999System time: 0.019999
Output for 5.4.32
Initial: 220064 bytes Final: 1269064 bytes Peak: 20470752 bytes User time: 0.343333System time: 0.009999
Output for 5.4.31
Initial: 220064 bytes Final: 1269064 bytes Peak: 20470752 bytes User time: 0.363333System time: 0.006666
Output for 5.4.30
Initial: 220064 bytes Final: 1269064 bytes Peak: 20470752 bytes User time: 0.273333System time: 0.006666
Output for 5.4.29
Initial: 220064 bytes Final: 1269064 bytes Peak: 20470752 bytes User time: 0.316666System time: 0.009999
Output for 5.4.28
Initial: 220064 bytes Final: 1269064 bytes Peak: 20470752 bytes User time: 0.359999System time: 0.009999
Output for 5.4.26
Initial: 220064 bytes Final: 1269064 bytes Peak: 20470752 bytes User time: 0.293333System time: 0.003333
Output for 5.4.22, 5.4.25
Initial: 220064 bytes Final: 1269064 bytes Peak: 20470752 bytes User time: 0.249999System time: 0.006666
Output for 5.4.24
Initial: 220064 bytes Final: 1269064 bytes Peak: 20470752 bytes User time: 0.236666System time: 0.016666
Output for 5.4.23
Initial: 220064 bytes Final: 1269064 bytes Peak: 20470752 bytes User time: 0.256666System time: 0.023333
Output for 5.4.21
Initial: 220064 bytes Final: 1269064 bytes Peak: 20470752 bytes User time: 0.269999System time: 0.013333
Output for 5.4.20
Initial: 220064 bytes Final: 1269064 bytes Peak: 20470752 bytes User time: 0.269999System time: 0.006666
Output for 5.4.19
Initial: 220064 bytes Final: 1269064 bytes Peak: 20470752 bytes User time: 0.246666System time: 0.013333
Output for 5.4.18
Initial: 220064 bytes Final: 1269064 bytes Peak: 20470752 bytes User time: 0.396666System time: 0.009999
Output for 5.4.17
Initial: 220064 bytes Final: 1269064 bytes Peak: 20470752 bytes User time: 0.356666System time: 0.013333
Output for 5.4.16
Initial: 220064 bytes Final: 1269064 bytes Peak: 20470752 bytes User time: 0.323333System time: 0.016666
Output for 5.4.15
Initial: 220064 bytes Final: 1269064 bytes Peak: 20470752 bytes User time: 0.343333System time: 0.003333
Output for 5.4.14
Initial: 220064 bytes Final: 1269064 bytes Peak: 20470752 bytes User time: 0.349999System time: 0.006666
Output for 5.4.13
Initial: 220064 bytes Final: 1269064 bytes Peak: 20470752 bytes User time: 0.316666System time: 0.003333
Output for 5.4.12
Initial: 220064 bytes Final: 1269064 bytes Peak: 20470752 bytes User time: 0.333333System time: 0.009999
Output for 5.4.10
Initial: 220064 bytes Final: 1269064 bytes Peak: 20470752 bytes User time: 0.353333System time: 0.006666
Output for 5.4.9
Initial: 219536 bytes Final: 1268536 bytes Peak: 20470304 bytes User time: 0.353333System time: 0.003333
Output for 5.4.8
Initial: 219536 bytes Final: 1268536 bytes Peak: 20470304 bytes User time: 0.306666System time: 0.013333
Output for 5.4.7
Initial: 219536 bytes Final: 1268536 bytes Peak: 20470304 bytes User time: 0.346666System time: 0.019999
Output for 5.4.6
Initial: 219536 bytes Final: 1268536 bytes Peak: 20470304 bytes User time: 0.349999System time: 0.013333
Output for 5.4.5
Initial: 219536 bytes Final: 1268536 bytes Peak: 20470304 bytes User time: 0.343333System time: 0.009999
Output for 5.4.4
Initial: 219536 bytes Final: 1268536 bytes Peak: 20470304 bytes User time: 0.359999System time: 0.009999
Output for 5.4.3
Initial: 219536 bytes Final: 1268536 bytes Peak: 20470304 bytes User time: 0.336666System time: 0
Output for 5.4.2
Initial: 219536 bytes Final: 1268536 bytes Peak: 20470304 bytes User time: 0.313333System time: 0.009999
Output for 5.4.1
Initial: 219536 bytes Final: 1268536 bytes Peak: 20470304 bytes User time: 0.369999System time: 0.003333
Output for 5.4.0
Initial: 219536 bytes Final: 1268536 bytes Peak: 20470304 bytes User time: 0.356666System time: 0.013333
Output for 5.3.29
Initial: 625096 bytes Final: 1674096 bytes Peak: 20876016 bytes User time: 0.419999System time: 0.016666
Output for 5.3.28
Initial: 625096 bytes Final: 1674096 bytes Peak: 20876016 bytes User time: 0.299999System time: 0
Output for 5.3.27
Initial: 625096 bytes Final: 1674096 bytes Peak: 20876016 bytes User time: 0.373333System time: 0.006666
Output for 5.3.26
Initial: 625096 bytes Final: 1674096 bytes Peak: 20876016 bytes User time: 0.383333System time: 0.006666
Output for 5.3.25
Initial: 625096 bytes Final: 1674096 bytes Peak: 20876016 bytes User time: 0.456666System time: 0.016666
Output for 5.3.24
Initial: 625096 bytes Final: 1674096 bytes Peak: 20876016 bytes User time: 0.373333System time: 0.009999
Output for 5.3.23
Initial: 625096 bytes Final: 1674096 bytes Peak: 20876016 bytes User time: 0.383333System time: 0.003333
Output for 5.3.22
Initial: 625096 bytes Final: 1674096 bytes Peak: 20876016 bytes User time: 0.429999System time: 0
Output for 5.3.21
Initial: 625096 bytes Final: 1674096 bytes Peak: 20876016 bytes User time: 0.403333System time: 0.013333
Output for 5.3.20
Initial: 625096 bytes Final: 1674096 bytes Peak: 20876016 bytes User time: 0.409999System time: 0.006666
Output for 5.3.19
Initial: 625096 bytes Final: 1674096 bytes Peak: 20876016 bytes User time: 0.429999System time: 0.006666
Output for 5.3.18
Initial: 625096 bytes Final: 1674096 bytes Peak: 20876016 bytes User time: 0.456666System time: 0.003333
Output for 5.3.17
Initial: 625096 bytes Final: 1674096 bytes Peak: 20876016 bytes User time: 0.396666System time: 0.003333
Output for 5.3.16
Initial: 625096 bytes Final: 1674096 bytes Peak: 20876016 bytes User time: 0.409999System time: 0.023333
Output for 5.3.15
Initial: 625096 bytes Final: 1674096 bytes Peak: 20876016 bytes User time: 0.433333System time: 0.003333
Output for 5.3.14
Initial: 625096 bytes Final: 1674096 bytes Peak: 20876016 bytes User time: 0.423333System time: 0.013333
Output for 5.3.13
Initial: 625096 bytes Final: 1674096 bytes Peak: 20876016 bytes User time: 0.419999System time: 0.003333
Output for 5.3.12
Initial: 625096 bytes Final: 1674096 bytes Peak: 20876016 bytes User time: 0.399999System time: 0.009999
Output for 5.3.11
Initial: 625096 bytes Final: 1674096 bytes Peak: 20876016 bytes User time: 0.413333System time: 0.006666
Output for 5.3.10
Initial: 624792 bytes Final: 1673792 bytes Peak: 20875640 bytes User time: 0.416666System time: 0.016666
Output for 5.3.9
Initial: 624792 bytes Final: 1673792 bytes Peak: 20875640 bytes User time: 0.433333System time: 0.003333
Output for 5.3.5, 5.3.8
Initial: 624792 bytes Final: 1673792 bytes Peak: 20875640 bytes User time: 0.419999System time: 0.009999
Output for 5.3.7
Initial: 624792 bytes Final: 1673792 bytes Peak: 20875640 bytes User time: 0.426666System time: 0.006666
Output for 5.3.6
Initial: 624792 bytes Final: 1673792 bytes Peak: 20875640 bytes User time: 0.429999System time: 0.003333
Output for 5.3.4
Initial: 624792 bytes Final: 1673792 bytes Peak: 20875640 bytes User time: 0.429999System time: 0.009999
Output for 5.3.3
Initial: 624792 bytes Final: 1673792 bytes Peak: 20875640 bytes User time: 0.379999System time: 0.003333
Output for 5.3.2
Initial: 624792 bytes Final: 1673792 bytes Peak: 20875640 bytes User time: 0.409999System time: 0.009999
Output for 5.3.1
Initial: 624792 bytes Final: 1673792 bytes Peak: 20875640 bytes User time: 0.406666System time: 0.016666
Output for 5.3.0
Initial: 624792 bytes Final: 1673792 bytes Peak: 20875640 bytes User time: 0.433333System time: 0.019999
Output for 5.2.17
Initial: 82736 bytes Final: 1131720 bytes Peak: 19533968 bytes User time: 0.449999System time: 0.006666
Output for 5.2.16
Initial: 82736 bytes Final: 1131720 bytes Peak: 19533968 bytes User time: 0.539999System time: 0.003333
Output for 5.2.15
Initial: 82736 bytes Final: 1131720 bytes Peak: 19533968 bytes User time: 0.476666System time: 0.023333
Output for 5.2.14
Initial: 82736 bytes Final: 1131720 bytes Peak: 19533968 bytes User time: 0.506666System time: 0.003333
Output for 5.2.13
Initial: 82736 bytes Final: 1131720 bytes Peak: 19533968 bytes User time: 0.459999System time: 0.003333
Output for 5.2.12
Initial: 82736 bytes Final: 1131720 bytes Peak: 19533968 bytes User time: 0.486666System time: 0
Output for 5.2.11
Initial: 82736 bytes Final: 1131720 bytes Peak: 19533968 bytes User time: 0.456666System time: 0.003333
Output for 5.2.10
Initial: 82736 bytes Final: 1131720 bytes Peak: 19533968 bytes User time: 0.513333System time: 0.016666
Output for 5.2.9
Initial: 83344 bytes Final: 1262856 bytes Peak: 19534088 bytes User time: 0.459999System time: 0
Output for 5.2.8
Initial: 83344 bytes Final: 1262856 bytes Peak: 19534088 bytes User time: 0.509999System time: 0.013333
Output for 5.2.7
Initial: 83344 bytes Final: 1262856 bytes Peak: 19534088 bytes User time: 0.493333System time: 0.006666
Output for 5.2.6
Initial: 83664 bytes Final: 1263200 bytes Peak: 19534368 bytes User time: 0.519999System time: 0.006666
Output for 5.2.5
Initial: 83664 bytes Final: 1263200 bytes Peak: 19534416 bytes User time: 0.516666System time: 0.009999
Output for 5.2.4
Initial: 83664 bytes Final: 1263200 bytes Peak: 19534416 bytes User time: 0.523333System time: 0.009999
Output for 5.2.3
Initial: 83664 bytes Final: 1263200 bytes Peak: 19534416 bytes User time: 0.523333System time: 0.006666
Output for 5.2.2
Initial: 81560 bytes Final: 1261080 bytes Peak: 19532328 bytes User time: 0.633333System time: 0.009999
Output for 5.2.1
Initial: 81560 bytes Final: 1162744 bytes Peak: 19531808 bytes User time: 0.573333System time: 0.019999
Output for 5.0.0 - 5.2.0
Fatal error: Call to undefined function memory_get_usage() in /in/6RAS3 on line 2
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: memory_get_usage() in /in/6RAS3 on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: memory_get_usage() in /in/6RAS3 on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: memory_get_usage() in /in/6RAS3 on line 2