3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function f() { $a = dirname('/a/b'); $c = array( 'a0' => $a . 'b0', 'a1' => $a . 'b1', 'a2' => $a . 'b2', 'a3' => $a . 'b3', 'a4' => $a . 'b4', 'a5' => $a . 'b5', 'a6' => $a . 'b6', 'a7' => $a . 'b7', 'a8' => $a . 'b8', 'a9' => $a . 'b9', 'a10' => $a . 'b10', 'a11' => $a . 'b11', 'a12' => $a . 'b12', 'a13' => $a . 'b13', 'a14' => $a . 'b14', 'a15' => $a . 'b15', 'a16' => $a . 'b16', 'a17' => $a . 'b17', 'a18' => $a . 'b18', 'a19' => $a . 'b19', 'a20' => $a . 'b20', 'a21' => $a . 'b21', 'a22' => $a . 'b22', 'a23' => $a . 'b23', 'a24' => $a . 'b24', 'a25' => $a . 'b25', 'a26' => $a . 'b26', 'a27' => $a . 'b27', 'a28' => $a . 'b28', 'a29' => $a . 'b29', 'a30' => $a . 'b30', 'a31' => $a . 'b31', 'a32' => $a . 'b32', 'a33' => $a . 'b33', 'a34' => $a . 'b34', 'a35' => $a . 'b35', 'a36' => $a . 'b36', 'a37' => $a . 'b37', 'a38' => $a . 'b38', 'a39' => $a . 'b39', 'a40' => $a . 'b40', 'a41' => $a . 'b41', 'a42' => $a . 'b42', 'a43' => $a . 'b43', 'a44' => $a . 'b44', 'a45' => $a . 'b45', 'a46' => $a . 'b46', 'a47' => $a . 'b47', 'a48' => $a . 'b48', 'a49' => $a . 'b49', 'a50' => $a . 'b50', 'a51' => $a . 'b51', 'a52' => $a . 'b52', 'a53' => $a . 'b53', 'a54' => $a . 'b54', 'a55' => $a . 'b55', 'a56' => $a . 'b56', 'a57' => $a . 'b57', 'a58' => $a . 'b58', 'a59' => $a . 'b59', 'a60' => $a . 'b60', 'a61' => $a . 'b61', 'a62' => $a . 'b62', 'a63' => $a . 'b63', 'a64' => $a . 'b64', 'a65' => $a . 'b65', 'a66' => $a . 'b66', 'a67' => $a . 'b67', 'a68' => $a . 'b68', 'a69' => $a . 'b69', 'a70' => $a . 'b70', 'a71' => $a . 'b71', 'a72' => $a . 'b72', 'a73' => $a . 'b73', 'a74' => $a . 'b74', 'a75' => $a . 'b75', 'a76' => $a . 'b76', 'a77' => $a . 'b77', 'a78' => $a . 'b78', 'a79' => $a . 'b79', 'a80' => $a . 'b80', 'a81' => $a . 'b81', 'a82' => $a . 'b82', 'a83' => $a . 'b83', 'a84' => $a . 'b84', 'a85' => $a . 'b85', 'a86' => $a . 'b86', 'a87' => $a . 'b87', 'a88' => $a . 'b88', 'a89' => $a . 'b89', 'a90' => $a . 'b90', 'a91' => $a . 'b91', 'a92' => $a . 'b92', 'a93' => $a . 'b93', 'a94' => $a . 'b94', 'a95' => $a . 'b95', 'a96' => $a . 'b96', 'a97' => $a . 'b97', 'a98' => $a . 'b98', 'a99' => $a . 'b99', 'a100' => $a . 'b100', 'a101' => $a . 'b101', 'a102' => $a . 'b102', 'a103' => $a . 'b103', 'a104' => $a . 'b104', 'a105' => $a . 'b105', 'a106' => $a . 'b106', 'a107' => $a . 'b107', 'a108' => $a . 'b108', 'a109' => $a . 'b109', 'a110' => $a . 'b110', 'a111' => $a . 'b111', 'a112' => $a . 'b112', 'a113' => $a . 'b113', 'a114' => $a . 'b114', 'a115' => $a . 'b115', 'a116' => $a . 'b116', 'a117' => $a . 'b117', 'a118' => $a . 'b118', 'a119' => $a . 'b119', 'a120' => $a . 'b120', 'a121' => $a . 'b121', 'a122' => $a . 'b122', 'a123' => $a . 'b123', 'a124' => $a . 'b124', 'a125' => $a . 'b125', 'a126' => $a . 'b126', 'a127' => $a . 'b127', 'a128' => $a . 'b128', 'a129' => $a . 'b129', 'a130' => $a . 'b130', 'a131' => $a . 'b131', 'a132' => $a . 'b132', 'a133' => $a . 'b133', 'a134' => $a . 'b134', 'a135' => $a . 'b135', 'a136' => $a . 'b136', 'a137' => $a . 'b137', 'a138' => $a . 'b138', 'a139' => $a . 'b139', 'a140' => $a . 'b140', 'a141' => $a . 'b141', 'a142' => $a . 'b142', 'a143' => $a . 'b143', 'a144' => $a . 'b144', 'a145' => $a . 'b145', 'a146' => $a . 'b146', 'a147' => $a . 'b147', 'a148' => $a . 'b148', 'a149' => $a . 'b149', 'a150' => $a . 'b150', 'a151' => $a . 'b151', 'a152' => $a . 'b152', 'a153' => $a . 'b153', 'a154' => $a . 'b154', 'a155' => $a . 'b155', 'a156' => $a . 'b156', 'a157' => $a . 'b157', 'a158' => $a . 'b158', 'a159' => $a . 'b159', 'a160' => $a . 'b160', 'a161' => $a . 'b161', 'a162' => $a . 'b162', 'a163' => $a . 'b163', 'a164' => $a . 'b164', 'a165' => $a . 'b165', 'a166' => $a . 'b166', 'a167' => $a . 'b167', 'a168' => $a . 'b168', 'a169' => $a . 'b169', 'a170' => $a . 'b170', 'a171' => $a . 'b171', 'a172' => $a . 'b172', 'a173' => $a . 'b173', 'a174' => $a . 'b174', 'a175' => $a . 'b175', 'a176' => $a . 'b176', 'a177' => $a . 'b177', 'a178' => $a . 'b178', 'a179' => $a . 'b179', 'a180' => $a . 'b180', 'a181' => $a . 'b181', 'a182' => $a . 'b182', 'a183' => $a . 'b183', 'a184' => $a . 'b184', 'a185' => $a . 'b185', 'a186' => $a . 'b186', 'a187' => $a . 'b187', 'a188' => $a . 'b188', 'a189' => $a . 'b189', 'a190' => $a . 'b190', 'a191' => $a . 'b191', 'a192' => $a . 'b192', 'a193' => $a . 'b193', 'a194' => $a . 'b194', 'a195' => $a . 'b195', 'a196' => $a . 'b196', 'a197' => $a . 'b197', 'a198' => $a . 'b198', 'a199' => $a . 'b199', 'a200' => $a . 'b200', 'a201' => $a . 'b201', 'a202' => $a . 'b202', 'a203' => $a . 'b203', 'a204' => $a . 'b204', 'a205' => $a . 'b205', 'a206' => $a . 'b206', 'a207' => $a . 'b207', 'a208' => $a . 'b208', 'a209' => $a . 'b209', 'a210' => $a . 'b210', 'a211' => $a . 'b211', 'a212' => $a . 'b212', 'a213' => $a . 'b213', 'a214' => $a . 'b214', 'a215' => $a . 'b215', 'a216' => $a . 'b216', 'a217' => $a . 'b217', 'a218' => $a . 'b218', 'a219' => $a . 'b219', 'a220' => $a . 'b220', 'a221' => $a . 'b221', 'a222' => $a . 'b222', 'a223' => $a . 'b223', 'a224' => $a . 'b224', 'a225' => $a . 'b225', 'a226' => $a . 'b226', 'a227' => $a . 'b227', 'a228' => $a . 'b228', 'a229' => $a . 'b229', 'a230' => $a . 'b230', 'a231' => $a . 'b231', 'a232' => $a . 'b232', 'a233' => $a . 'b233', 'a234' => $a . 'b234', 'a235' => $a . 'b235', 'a236' => $a . 'b236', 'a237' => $a . 'b237', 'a238' => $a . 'b238', 'a239' => $a . 'b239', 'a240' => $a . 'b240', 'a241' => $a . 'b241', 'a242' => $a . 'b242', 'a243' => $a . 'b243', 'a244' => $a . 'b244', 'a245' => $a . 'b245', 'a246' => $a . 'b246', 'a247' => $a . 'b247', 'a248' => $a . 'b248', 'a249' => $a . 'b249', 'a250' => $a . 'b250', 'a251' => $a . 'b251', 'a252' => $a . 'b252', 'a253' => $a . 'b253', 'a254' => $a . 'b254', 'a255' => $a . 'b255', 'a256' => $a . 'b256', 'a257' => $a . 'b257', 'a258' => $a . 'b258', 'a259' => $a . 'b259', 'a260' => $a . 'b260', 'a261' => $a . 'b261', 'a262' => $a . 'b262', 'a263' => $a . 'b263', 'a264' => $a . 'b264', 'a265' => $a . 'b265', 'a266' => $a . 'b266', 'a267' => $a . 'b267', 'a268' => $a . 'b268', 'a269' => $a . 'b269', 'a270' => $a . 'b270', 'a271' => $a . 'b271', 'a272' => $a . 'b272', 'a273' => $a . 'b273', 'a274' => $a . 'b274', 'a275' => $a . 'b275', 'a276' => $a . 'b276', 'a277' => $a . 'b277', 'a278' => $a . 'b278', 'a279' => $a . 'b279', 'a280' => $a . 'b280', 'a281' => $a . 'b281', 'a282' => $a . 'b282', 'a283' => $a . 'b283', 'a284' => $a . 'b284', 'a285' => $a . 'b285', 'a286' => $a . 'b286', 'a287' => $a . 'b287', 'a288' => $a . 'b288', 'a289' => $a . 'b289', 'a290' => $a . 'b290', 'a291' => $a . 'b291', 'a292' => $a . 'b292', 'a293' => $a . 'b293', 'a294' => $a . 'b294', 'a295' => $a . 'b295', 'a296' => $a . 'b296', 'a297' => $a . 'b297', 'a298' => $a . 'b298', 'a299' => $a . 'b299', 'a300' => $a . 'b300', 'a301' => $a . 'b301', 'a302' => $a . 'b302', 'a303' => $a . 'b303', 'a304' => $a . 'b304', 'a305' => $a . 'b305', 'a306' => $a . 'b306', 'a307' => $a . 'b307', 'a308' => $a . 'b308', 'a309' => $a . 'b309', 'a310' => $a . 'b310', 'a311' => $a . 'b311', 'a312' => $a . 'b312', 'a313' => $a . 'b313', 'a314' => $a . 'b314', 'a315' => $a . 'b315', 'a316' => $a . 'b316', 'a317' => $a . 'b317', 'a318' => $a . 'b318', 'a319' => $a . 'b319', 'a320' => $a . 'b320', 'a321' => $a . 'b321', 'a322' => $a . 'b322', 'a323' => $a . 'b323', 'a324' => $a . 'b324', 'a325' => $a . 'b325', 'a326' => $a . 'b326', 'a327' => $a . 'b327', 'a328' => $a . 'b328', 'a329' => $a . 'b329', 'a330' => $a . 'b330', 'a331' => $a . 'b331', 'a332' => $a . 'b332', 'a333' => $a . 'b333', 'a334' => $a . 'b334', 'a335' => $a . 'b335', 'a336' => $a . 'b336', 'a337' => $a . 'b337', 'a338' => $a . 'b338', 'a339' => $a . 'b339', 'a340' => $a . 'b340', 'a341' => $a . 'b341', 'a342' => $a . 'b342', 'a343' => $a . 'b343', 'a344' => $a . 'b344', 'a345' => $a . 'b345', 'a346' => $a . 'b346', 'a347' => $a . 'b347', 'a348' => $a . 'b348', 'a349' => $a . 'b349', 'a350' => $a . 'b350', 'a351' => $a . 'b351', 'a352' => $a . 'b352', 'a353' => $a . 'b353', 'a354' => $a . 'b354', 'a355' => $a . 'b355', 'a356' => $a . 'b356', 'a357' => $a . 'b357', 'a358' => $a . 'b358', 'a359' => $a . 'b359', 'a360' => $a . 'b360', 'a361' => $a . 'b361', 'a362' => $a . 'b362', 'a363' => $a . 'b363', 'a364' => $a . 'b364', 'a365' => $a . 'b365', 'a366' => $a . 'b366', 'a367' => $a . 'b367', 'a368' => $a . 'b368', ); return $c; } function somethingElse($a) { } $startTime = microtime(true); $startMem = memory_get_usage(true); $d = f(); $endTime = microtime(true); $endMem = memory_get_usage(true); $time = $endTime - $startTime; $mem = $endMem - $startMem; printf("%s: time = %f s, mem %d kb\n", 'func', $time, $mem/1024); somethingElse($d);
based on qXdaV
Output for 7.2.0
func: time = 0.000022 s, mem 0 kb
Output for 7.1.7
func: time = 0.000017 s, mem 0 kb
Output for 7.1.6
func: time = 0.000031 s, mem 0 kb
Output for 7.1.5
func: time = 0.000015 s, mem 0 kb
Output for 7.1.0
func: time = 0.000025 s, mem 0 kb
Output for 7.0.6, 7.0.20
func: time = 0.000021 s, mem 0 kb
Output for 7.0.10
func: time = 0.000020 s, mem 0 kb
Output for 7.0.0, 7.0.2, 7.0.7, 7.0.9
func: time = 0.000012 s, mem 0 kb
Output for 7.0.4, 7.0.8
func: time = 0.000023 s, mem 0 kb
Output for 7.0.5
func: time = 0.000016 s, mem 0 kb
Output for 7.0.1, 7.0.3
func: time = 0.000013 s, mem 0 kb
Output for 5.5.12, 5.6.28
func: time = 0.000077 s, mem 0 kb
Output for 5.6.25
func: time = 0.000085 s, mem 0 kb
Output for 5.5.6, 5.6.4, 5.6.12 - 5.6.13, 5.6.24
func: time = 0.000049 s, mem 0 kb
Output for 5.5.15, 5.5.20, 5.5.22, 5.5.26, 5.5.32, 5.5.36, 5.6.6, 5.6.8 - 5.6.9, 5.6.16, 5.6.23
func: time = 0.000050 s, mem 0 kb
Output for 5.6.22
func: time = 0.000043 s, mem 0 kb
Output for 5.5.9, 5.5.19, 5.5.34, 5.6.2, 5.6.21
func: time = 0.000046 s, mem 0 kb
Output for 5.5.25, 5.5.27, 5.6.14, 5.6.19 - 5.6.20
func: time = 0.000051 s, mem 0 kb
Output for 5.6.18
func: time = 0.000056 s, mem 0 kb
Output for 5.5.1, 5.6.17
func: time = 0.000062 s, mem 0 kb
Output for 5.6.15
func: time = 0.000042 s, mem 0 kb
Output for 5.6.11
func: time = 0.000065 s, mem 0 kb
Output for 5.5.28, 5.6.10
func: time = 0.000053 s, mem 0 kb
Output for 5.5.21, 5.5.24, 5.5.38, 5.6.1, 5.6.7
func: time = 0.000048 s, mem 0 kb
Output for 5.6.5
func: time = 0.000047 s, mem 0 kb
Output for 5.5.11, 5.6.3
func: time = 0.000040 s, mem 0 kb
Output for 5.6.0
func: time = 0.000086 s, mem 0 kb
Output for 5.5.29, 5.5.37
func: time = 0.000052 s, mem 0 kb
Output for 5.5.5, 5.5.31, 5.5.35
func: time = 0.000072 s, mem 0 kb
Output for 5.5.13, 5.5.33
func: time = 0.000044 s, mem 0 kb
Output for 5.5.30
func: time = 0.000084 s, mem 0 kb
Output for 5.5.23
func: time = 0.000075 s, mem 0 kb
Output for 5.5.18
func: time = 0.000055 s, mem 0 kb
Output for 5.5.16
func: time = 0.000070 s, mem 0 kb
Output for 5.5.8, 5.5.14
func: time = 0.000061 s, mem 0 kb
Output for 5.5.10
func: time = 0.000039 s, mem 0 kb
Output for 5.5.3, 5.5.7
func: time = 0.000080 s, mem 0 kb
Output for 5.5.4
func: time = 0.000082 s, mem 0 kb
Output for 5.5.2
func: time = 0.000079 s, mem 0 kb
Output for 5.5.0
func: time = 0.000063 s, mem 0 kb