3v4l.org

run code in 300+ PHP versions simultaneously
<?php function measure($c) { $start = hrtime(true); $c(); var_dump(hrtime(true) - $start); } const ITERS = 10000; measure(function () { $array = []; for ($i = 0; $i < ITERS; $i++) { $array[] = $i; } }); measure(function () { $array = []; for ($i = 0; $i < ITERS; $i++) { $copy = $array; $array[] = $i; } });
Output for 8.5.0
int(429389) int(93709463)
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.
Output for 8.4.14
int(397691) int(80707220)
Output for 8.4.13
int(132201) int(34484048)
Output for 8.4.12
int(318729) int(49398969)
Output for 8.4.11
int(306288) int(55133525)
Output for 8.4.10
int(324298) int(51915840)
Output for 8.4.9
int(272488) int(53893905)
Output for 8.4.8
int(150969) int(39712794)
Output for 8.4.7
int(309867) int(43996521)
Output for 8.4.6
int(366977) int(43541424)
Output for 8.4.5
int(159460) int(42240836)
Output for 8.4.4
int(458296) int(56147351)
Output for 8.4.3
int(370438) int(72452227)
Output for 8.4.2
int(389947) int(48644151)
Output for 8.4.1
int(393504) int(89546356)
Output for 8.3.28
int(430619) int(79580532)
Output for 8.3.27
int(456269) int(81570086)
Output for 8.3.26
int(417976) int(51138195)
Output for 8.3.25
int(492637) int(57714396)
Output for 8.3.24
int(317159) int(49493711)
Output for 8.3.23
int(332237) int(52036690)
Output for 8.3.22
int(386638) int(49578907)
Output for 8.3.21
int(409947) int(55605078)
Output for 8.3.20
int(165049) int(37683796)
Output for 8.3.19
int(214760) int(52760780)
Output for 8.3.18
int(402377) int(51518329)
Output for 8.3.17
int(403747) int(54049384)
Output for 8.3.16
int(381666) int(58614098)
Output for 8.3.15
int(377377) int(45145217)
Output for 8.3.14
int(390726) int(67666266)
Output for 8.3.13
int(240461) int(37920731)
Output for 8.3.12
int(365352) int(72596486)
Output for 8.3.11
int(159861) int(37466622)
Output for 8.3.10
int(341555) int(62988665)
Output for 8.3.9
int(87783) int(37031260)
Output for 8.3.8
int(261761) int(72915308)
Output for 8.3.7
int(307132) int(106309725)
Output for 8.3.6
int(438821) int(75956917)
Output for 8.3.5
int(203667) int(70079771)
Output for 8.3.4
int(245169) int(98157595)
Output for 8.3.3
int(320161) int(81017386)
Output for 8.3.2
int(157918) int(69451699)
Output for 8.3.1
int(235565) int(98008422)
Output for 8.3.0
int(172219) int(88952014)
Output for 8.2.29
int(323157) int(44925219)
Output for 8.2.28
int(179049) int(44532651)
Output for 8.2.27
int(440817) int(63007874)
Output for 8.2.26
int(287406) int(46781986)
Output for 8.2.25
int(91938) int(37587918)
Output for 8.2.24
int(95204) int(42319231)
Output for 8.2.23
int(95695) int(55817883)
Output for 8.2.22
int(174112) int(37068951)
Output for 8.2.21
int(93971) int(55887890)
Output for 8.2.20
int(187932) int(49424898)
Output for 8.2.19
int(378531) int(90439994)
Output for 8.2.18
int(435255) int(87092024)
Output for 8.2.17
int(171758) int(69637879)
Output for 8.2.16
int(240342) int(91532652)
Output for 8.2.15
int(278720) int(89411305)
Output for 8.2.14
int(278230) int(101319932)
Output for 8.2.13
int(284048) int(80612637)
Output for 8.2.12
int(250889) int(87609911)
Output for 8.2.11
int(195585) int(70567309)
Output for 8.2.10
int(313272) int(89735284)
Output for 8.2.9
int(190056) int(69421443)
Output for 8.2.8
int(187412) int(70154657)
Output for 8.2.7
int(171058) int(69051234)
Output for 8.2.6
int(259271) int(80267186)
Output for 8.2.5
int(253382) int(97625654)
Output for 8.2.4
int(304920) int(78486704)
Output for 8.2.3
int(334253) int(103975513)
Output for 8.2.2
int(198429) int(69654735)
Output for 8.2.1
int(172320) int(80542432)
Output for 8.2.0
int(251138) int(87070198)
Output for 8.1.33
int(501226) int(82424780)
Output for 8.1.32
int(545074) int(71942443)
Output for 8.1.31
int(92149) int(57307980)
Output for 8.1.30
int(293893) int(57402504)
Output for 8.1.29
int(195807) int(78636302)
Output for 8.1.28
int(515687) int(116840558)
Output for 8.1.27
int(168845) int(116534198)
Output for 8.1.26
int(167953) int(110778345)
Output for 8.1.25
int(251228) int(119660029)
Output for 8.1.24
int(181414) int(110305793)
Output for 8.1.23
int(244088) int(116761040)
Output for 8.1.22
int(182997) int(108773013)
Output for 8.1.21
int(176936) int(111012447)
Output for 8.1.20
int(175564) int(109151193)
Output for 8.1.19
int(190889) int(112123472)
Output for 8.1.18
int(173611) int(131835416)
Output for 8.1.17
int(255244) int(133541579)
Output for 8.1.16
int(265199) int(136693879)
Output for 8.1.15
int(219450) int(112987224)
Output for 8.1.14
int(337578) int(136368378)
Output for 8.1.13
int(210408) int(126188297)
Output for 8.1.12
int(256856) int(141969237)
Output for 8.1.11
int(264850) int(128726582)
Output for 8.1.10
int(169415) int(130414526)
Output for 8.1.9
int(257437) int(118993874)
Output for 8.1.8
int(252409) int(136624523)
Output for 8.1.7
int(261675) int(128527181)
Output for 8.1.6
int(280433) int(128198506)
Output for 8.1.5
int(352422) int(129277271)
Output for 8.1.4
int(275986) int(118930900)
Output for 8.1.3
int(265480) int(132454550)
Output for 8.1.2
int(273372) int(116045073)
Output for 8.1.1
int(180422) int(108606993)
Output for 8.1.0
int(190247) int(109096501)

preferences:
95.46 ms | 556 KiB | 5 Q