3v4l.org

run code in 300+ PHP versions simultaneously
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); <?php $a = range(0, 250_000); $b = range(250_000, 500_000); $start = microtime(true); foreach(array_merge($a, $b) as $key => $item){ // } $elapsed = microtime(true) - $start; var_dump($elapsed); $gen = function(array ...$input):iterable{foreach($input as $it) {yield from $it;}}; $start = microtime(true); foreach($gen($a, $b) as $key => $item){ // } $elapsed = microtime(true) - $start; var_dump($elapsed);
Output for 8.3.10
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.013849020004272461) float(0.009703874588012695)
Output for 8.3.9
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.008767843246459961) float(0.009981155395507812)
Output for 8.3.8
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.009766101837158203) float(0.009453058242797852)
Output for 8.3.7
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.008873939514160156) float(0.009580135345458984)
Output for 8.3.6
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.010050058364868164) float(0.012725830078125)
Output for 8.3.5
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.009087085723876953) float(0.01028895378112793)
Output for 8.3.4
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.010740995407104492) float(0.012688159942626953)
Output for 8.3.3
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.009657144546508789) float(0.009938955307006836)
Output for 8.3.2
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.01311802864074707) float(0.009923934936523438)
Output for 8.3.1
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.008872032165527344) float(0.009638071060180664)
Output for 8.3.0
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.014199018478393555) float(0.012464046478271484)
Output for 8.2.22
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.008530855178833008) float(0.009834051132202148)
Output for 8.2.21
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.008706092834472656) float(0.009747028350830078)
Output for 8.2.20
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.016644001007080078) float(0.019594907760620117)
Output for 8.2.19
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.00973200798034668) float(0.009979963302612305)
Output for 8.2.18
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.008834123611450195) float(0.00948190689086914)
Output for 8.2.17
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.009380817413330078) float(0.009842157363891602)
Output for 8.2.16
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.009419918060302734) float(0.010416984558105469)
Output for 8.2.15
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.009203910827636719) float(0.009882926940917969)
Output for 8.2.14
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.008684158325195312) float(0.009676933288574219)
Output for 8.2.13
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.009493112564086914) float(0.010724067687988281)
Output for 8.2.12
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.008612871170043945) float(0.009984016418457031)
Output for 8.2.11
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.018130064010620117) float(0.012202978134155273)
Output for 8.2.10
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.012918949127197266) float(0.009749889373779297)
Output for 8.2.9
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.016386985778808594) float(0.010725975036621094)
Output for 8.2.8
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.008779048919677734) float(0.009654998779296875)
Output for 8.2.7
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.008991003036499023) float(0.009660959243774414)
Output for 8.2.6
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.008804082870483398) float(0.009732961654663086)
Output for 8.2.5
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.020603179931640625) float(0.024255037307739258)
Output for 8.2.4
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.021179914474487305) float(0.010901927947998047)
Output for 8.2.3
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.00887608528137207) float(0.009881973266601562)
Output for 8.2.2
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.009072065353393555) float(0.009668111801147461)
Output for 8.2.1
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.019706010818481445) float(0.014971017837524414)
Output for 8.2.0
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.01650094985961914) float(0.009907960891723633)
Output for 8.1.29
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.020282983779907227) float(0.009469032287597656)
Output for 8.1.28
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.015640974044799805) float(0.009679079055786133)
Output for 8.1.2 - 8.1.27
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); Fatal error: Out of memory (allocated 18882560) (tried to allocate 16777224 bytes) in /in/HMasj on line 14 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.1.1
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.025433063507080078) float(0.009150028228759766)
Output for 8.1.0
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); float(0.0244290828704834) float(0.008747100830078125)

preferences:
52.53 ms | 465 KiB | 5 Q