3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // test one.. // start time $st = microtime(); function arr1(){ $arr1 = array(); $arr2 = array(); $arr3 = array(); $arr1['key1'] = 'val1'; $arr2['key1'] = 'val1'; $arr3['key1'] = 'val1'; return array($arr1, $arr2, $arr3); } $i = 1000; while($i--){ $poo = arr1(); } echo "Method 1: created 1000 arrays in " . (microtime() - $st) . " microseconds...\n"; // test two.. // start time $st = microtime(); function arr2(){ $arr1 = array(); $arr1['arr1']['key1'] = 'val1'; $arr1['arr2']['key1'] = 'val1'; $arr1['arr3']['key1'] = 'val1'; return array($arr1); } $i = 1000; while($i--){ $poo = arr2(); } echo "Method 2: created 1000 arrays in " . (microtime() - $st) . " microseconds...\n";
based on SQqsY
Output for 7.3.1
Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Method 1: created 1000 arrays in 0.000773 microseconds... Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Method 2: created 1000 arrays in 0.000754 microseconds...
Output for 7.3.0
Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Method 1: created 1000 arrays in 0.000444 microseconds... Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Method 2: created 1000 arrays in 0.000403 microseconds...
Output for 7.2.13
Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Method 1: created 1000 arrays in 0.000543 microseconds... Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Method 2: created 1000 arrays in 0.000534 microseconds...
Output for 7.2.12
Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Method 1: created 1000 arrays in 0.000493 microseconds... Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Method 2: created 1000 arrays in 0.000428 microseconds...
Output for 7.2.11
Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Method 1: created 1000 arrays in 0.000528 microseconds... Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Method 2: created 1000 arrays in 0.000493 microseconds...
Output for 7.2.10
Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Method 1: created 1000 arrays in 0.000701 microseconds... Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Method 2: created 1000 arrays in 0.000607 microseconds...
Output for 7.2.9
Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Method 1: created 1000 arrays in 0.000537 microseconds... Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Method 2: created 1000 arrays in 0.000472 microseconds...
Output for 7.2.8
Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Method 1: created 1000 arrays in 0.000498 microseconds... Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Method 2: created 1000 arrays in 0.000405 microseconds...
Output for 7.2.7
Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Method 1: created 1000 arrays in 0.000613 microseconds... Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Method 2: created 1000 arrays in 0.000549 microseconds...
Output for 7.2.6
Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Method 1: created 1000 arrays in 0.00055 microseconds... Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Method 2: created 1000 arrays in 0.000511 microseconds...
Output for 7.2.5
Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Method 1: created 1000 arrays in 0.000721 microseconds... Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Method 2: created 1000 arrays in 0.000666 microseconds...
Output for 7.2.4
Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Method 1: created 1000 arrays in 0.000399 microseconds... Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Method 2: created 1000 arrays in 0.000353 microseconds...
Output for 7.2.3
Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Method 1: created 1000 arrays in 0.000636 microseconds... Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Method 2: created 1000 arrays in 0.000592 microseconds...
Output for 7.2.2
Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Method 1: created 1000 arrays in 0.000404 microseconds... Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Method 2: created 1000 arrays in 0.000351 microseconds...
Output for 7.2.1
Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Method 1: created 1000 arrays in 0.000573 microseconds... Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Method 2: created 1000 arrays in 0.000543 microseconds...
Output for 7.2.0
Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Method 1: created 1000 arrays in 0.000413 microseconds... Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Method 2: created 1000 arrays in 0.000394 microseconds...
Output for 7.1.25
Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Method 1: created 1000 arrays in 0.000562 microseconds... Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Method 2: created 1000 arrays in 0.000615 microseconds...
Output for 7.1.7
Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Method 1: created 1000 arrays in 0.00031 microseconds... Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Method 2: created 1000 arrays in 0.000322 microseconds...
Output for 7.1.6
Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Method 1: created 1000 arrays in 0.000642 microseconds... Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Method 2: created 1000 arrays in 0.000709 microseconds...
Output for 7.1.5
Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Method 1: created 1000 arrays in 0.000241 microseconds... Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Method 2: created 1000 arrays in 0.000263 microseconds...
Output for 7.1.0
Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Notice: A non well formed numeric value encountered in /in/3oudf on line 26 Method 1: created 1000 arrays in 0.000461 microseconds... Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Notice: A non well formed numeric value encountered in /in/3oudf on line 49 Method 2: created 1000 arrays in 0.000494 microseconds...
Output for 7.0.20
Method 1: created 1000 arrays in 0.000353 microseconds... Method 2: created 1000 arrays in 0.000399 microseconds...
Output for 7.0.6
Method 1: created 1000 arrays in 0.00038700000000003 microseconds... Method 2: created 1000 arrays in 0.00040099999999998 microseconds...
Output for 7.0.5
Method 1: created 1000 arrays in 0.00024099999999999 microseconds... Method 2: created 1000 arrays in 0.00026899999999999 microseconds...
Output for 7.0.4
Method 1: created 1000 arrays in 0.00042800000000001 microseconds... Method 2: created 1000 arrays in 0.000448 microseconds...
Output for 7.0.3
Method 1: created 1000 arrays in 0.00029599999999996 microseconds... Method 2: created 1000 arrays in 0.00029800000000002 microseconds...
Output for 7.0.2
Method 1: created 1000 arrays in 0.000252 microseconds... Method 2: created 1000 arrays in 0.00025900000000001 microseconds...
Output for 7.0.1
Method 1: created 1000 arrays in 0.00034100000000001 microseconds... Method 2: created 1000 arrays in 0.00055899999999998 microseconds...
Output for 7.0.0
Method 1: created 1000 arrays in 0.000359 microseconds... Method 2: created 1000 arrays in 0.00036400000000003 microseconds...
Output for 5.6.28
Method 1: created 1000 arrays in 0.00104 microseconds... Method 2: created 1000 arrays in 0.00108 microseconds...
Output for 5.6.21
Method 1: created 1000 arrays in 0.000579 microseconds... Method 2: created 1000 arrays in 0.00059100000000001 microseconds...
Output for 5.6.20
Method 1: created 1000 arrays in 0.000942 microseconds... Method 2: created 1000 arrays in 0.00097599999999998 microseconds...
Output for 5.6.19
Method 1: created 1000 arrays in 0.00085499999999999 microseconds... Method 2: created 1000 arrays in 0.00076199999999998 microseconds...
Output for 5.6.18
Method 1: created 1000 arrays in 0.00088900000000003 microseconds... Method 2: created 1000 arrays in 0.00060899999999997 microseconds...
Output for 5.6.17
Method 1: created 1000 arrays in 0.000809 microseconds... Method 2: created 1000 arrays in 0.00081300000000001 microseconds...
Output for 5.6.16
Method 1: created 1000 arrays in 0.00067799999999996 microseconds... Method 2: created 1000 arrays in 0.00069299999999994 microseconds...
Output for 5.6.15
Method 1: created 1000 arrays in 0.00091200000000002 microseconds... Method 2: created 1000 arrays in 0.00095200000000001 microseconds...
Output for 5.6.14
Method 1: created 1000 arrays in 0.00058600000000003 microseconds... Method 2: created 1000 arrays in 0.00060899999999997 microseconds...
Output for 5.6.13
Method 1: created 1000 arrays in 0.00091500000000005 microseconds... Method 2: created 1000 arrays in 0.00093199999999999 microseconds...
Output for 5.6.12
Method 1: created 1000 arrays in 0.00057200000000002 microseconds... Method 2: created 1000 arrays in 0.00059100000000001 microseconds...
Output for 5.6.11
Method 1: created 1000 arrays in 0.00090800000000002 microseconds... Method 2: created 1000 arrays in 0.0010020000000001 microseconds...
Output for 5.6.10
Method 1: created 1000 arrays in 0.00089199999999999 microseconds... Method 2: created 1000 arrays in 0.000942 microseconds...
Output for 5.6.9
Method 1: created 1000 arrays in 0.00085099999999999 microseconds... Method 2: created 1000 arrays in 0.000803 microseconds...
Output for 5.6.8
Method 1: created 1000 arrays in 0.00093299999999999 microseconds... Method 2: created 1000 arrays in 0.00098200000000001 microseconds...
Output for 5.5.35
Method 1: created 1000 arrays in 0.00049399999999999 microseconds... Method 2: created 1000 arrays in 0.00051299999999999 microseconds...
Output for 5.5.34
Method 1: created 1000 arrays in 0.0010709999999999 microseconds... Method 2: created 1000 arrays in 0.001035 microseconds...
Output for 5.5.33
Method 1: created 1000 arrays in 0.000581 microseconds... Method 2: created 1000 arrays in 0.00062899999999999 microseconds...
Output for 5.5.32
Method 1: created 1000 arrays in 0.00059300000000001 microseconds... Method 2: created 1000 arrays in 0.00062199999999996 microseconds...
Output for 5.5.31
Method 1: created 1000 arrays in 0.000751 microseconds... Method 2: created 1000 arrays in 0.000803 microseconds...
Output for 5.5.30
Method 1: created 1000 arrays in 0.00095499999999998 microseconds... Method 2: created 1000 arrays in 0.001037 microseconds...
Output for 5.5.29
Method 1: created 1000 arrays in 0.000942 microseconds... Method 2: created 1000 arrays in 0.00098300000000001 microseconds...
Output for 5.5.28
Method 1: created 1000 arrays in 0.00093300000000007 microseconds... Method 2: created 1000 arrays in 0.00099800000000005 microseconds...
Output for 5.5.27
Method 1: created 1000 arrays in 0.000579 microseconds... Method 2: created 1000 arrays in 0.0006179999999999 microseconds...
Output for 5.5.26
Method 1: created 1000 arrays in 0.00057299999999999 microseconds... Method 2: created 1000 arrays in 0.00060900000000003 microseconds...
Output for 5.5.25
Method 1: created 1000 arrays in 0.00057699999999994 microseconds... Method 2: created 1000 arrays in 0.00060099999999996 microseconds...
Output for 5.5.24
Method 1: created 1000 arrays in 0.00082499999999996 microseconds... Method 2: created 1000 arrays in 0.000861 microseconds...
Output for 5.4.45
Method 1: created 1000 arrays in 0.000946 microseconds... Method 2: created 1000 arrays in 0.001345 microseconds...
Output for 5.4.44
Method 1: created 1000 arrays in 0.00090799999999996 microseconds... Method 2: created 1000 arrays in 0.001064 microseconds...
Output for 5.4.43
Method 1: created 1000 arrays in 0.000919 microseconds... Method 2: created 1000 arrays in 0.00098199999999998 microseconds...
Output for 5.4.42
Method 1: created 1000 arrays in 0.00097000000000003 microseconds... Method 2: created 1000 arrays in 0.00124 microseconds...
Output for 5.4.41
Method 1: created 1000 arrays in 0.0010559999999999 microseconds... Method 2: created 1000 arrays in 0.001161 microseconds...
Output for 5.4.40
Method 1: created 1000 arrays in 0.00097099999999994 microseconds... Method 2: created 1000 arrays in 0.0018 microseconds...
Output for 5.4.39
Method 1: created 1000 arrays in 0.001034 microseconds... Method 2: created 1000 arrays in 0.001049 microseconds...
Output for 5.4.38
Method 1: created 1000 arrays in 0.000933 microseconds... Method 2: created 1000 arrays in 0.001153 microseconds...
Output for 5.4.37
Method 1: created 1000 arrays in 0.00090299999999999 microseconds... Method 2: created 1000 arrays in 0.00092199999999998 microseconds...
Output for 5.4.36
Method 1: created 1000 arrays in 0.00089899999999998 microseconds... Method 2: created 1000 arrays in 0.00089500000000003 microseconds...
Output for 5.4.35
Method 1: created 1000 arrays in 0.00095900000000004 microseconds... Method 2: created 1000 arrays in 0.00099400000000005 microseconds...
Output for 5.4.34
Method 1: created 1000 arrays in 0.001096 microseconds... Method 2: created 1000 arrays in 0.001839 microseconds...
Output for 5.4.32
Method 1: created 1000 arrays in 0.001031 microseconds... Method 2: created 1000 arrays in 0.0010690000000001 microseconds...
Output for 5.4.31
Method 1: created 1000 arrays in 0.00092400000000004 microseconds... Method 2: created 1000 arrays in 0.0012770000000001 microseconds...
Output for 5.4.30
Method 1: created 1000 arrays in 0.00097 microseconds... Method 2: created 1000 arrays in 0.000939 microseconds...
Output for 5.4.29
Method 1: created 1000 arrays in 0.00088499999999997 microseconds... Method 2: created 1000 arrays in 0.00091000000000002 microseconds...
Output for 5.4.28
Method 1: created 1000 arrays in 0.00094099999999997 microseconds... Method 2: created 1000 arrays in 0.00099699999999997 microseconds...
Output for 5.4.27
Method 1: created 1000 arrays in 0.0011180000000001 microseconds... Method 2: created 1000 arrays in 0.000911 microseconds...
Output for 5.4.26
Method 1: created 1000 arrays in 0.0012 microseconds... Method 2: created 1000 arrays in 0.001441 microseconds...
Output for 5.4.25
Method 1: created 1000 arrays in 0.0055400000000001 microseconds... Method 2: created 1000 arrays in 0.00097800000000003 microseconds...
Output for 5.4.24
Method 1: created 1000 arrays in 0.001014 microseconds... Method 2: created 1000 arrays in 0.001083 microseconds...
Output for 5.4.23
Method 1: created 1000 arrays in 0.00092899999999999 microseconds... Method 2: created 1000 arrays in 0.00093200000000002 microseconds...
Output for 5.4.22
Method 1: created 1000 arrays in 0.00089800000000001 microseconds... Method 2: created 1000 arrays in 0.001158 microseconds...
Output for 5.4.21
Method 1: created 1000 arrays in 0.00097999999999998 microseconds... Method 2: created 1000 arrays in 0.001389 microseconds...
Output for 5.4.20
Method 1: created 1000 arrays in 0.000892 microseconds... Method 2: created 1000 arrays in 0.001173 microseconds...
Output for 5.4.19
Method 1: created 1000 arrays in 0.001009 microseconds... Method 2: created 1000 arrays in 0.001067 microseconds...
Output for 5.4.18
Method 1: created 1000 arrays in 0.000929 microseconds... Method 2: created 1000 arrays in 0.001213 microseconds...
Output for 5.4.17
Method 1: created 1000 arrays in 0.000971 microseconds... Method 2: created 1000 arrays in 0.00114 microseconds...
Output for 5.4.16
Method 1: created 1000 arrays in 0.00098900000000002 microseconds... Method 2: created 1000 arrays in 0.001816 microseconds...
Output for 5.4.15
Method 1: created 1000 arrays in 0.00091200000000002 microseconds... Method 2: created 1000 arrays in 0.00094300000000003 microseconds...
Output for 5.4.14
Method 1: created 1000 arrays in 0.001053 microseconds... Method 2: created 1000 arrays in 0.000884 microseconds...
Output for 5.4.13
Method 1: created 1000 arrays in 0.00090600000000007 microseconds... Method 2: created 1000 arrays in 0.001067 microseconds...
Output for 5.4.12
Method 1: created 1000 arrays in 0.000926 microseconds... Method 2: created 1000 arrays in 0.001105 microseconds...
Output for 5.4.11
Method 1: created 1000 arrays in 0.000911 microseconds... Method 2: created 1000 arrays in 0.00095499999999998 microseconds...
Output for 5.4.10
Method 1: created 1000 arrays in 0.00093300000000002 microseconds... Method 2: created 1000 arrays in 0.00095699999999999 microseconds...
Output for 5.4.9
Method 1: created 1000 arrays in 0.001309 microseconds... Method 2: created 1000 arrays in 0.000917 microseconds...
Output for 5.4.8
Method 1: created 1000 arrays in 0.00090400000000002 microseconds... Method 2: created 1000 arrays in 0.001149 microseconds...
Output for 5.4.7
Method 1: created 1000 arrays in 0.00064500000000001 microseconds... Method 2: created 1000 arrays in 0.00065399999999993 microseconds...
Output for 5.4.6
Method 1: created 1000 arrays in 0.00093300000000002 microseconds... Method 2: created 1000 arrays in 0.000976 microseconds...
Output for 5.4.5
Method 1: created 1000 arrays in 0.00093399999999999 microseconds... Method 2: created 1000 arrays in 0.00097799999999998 microseconds...
Output for 5.4.4
Method 1: created 1000 arrays in 0.00092499999999995 microseconds... Method 2: created 1000 arrays in 0.00096699999999994 microseconds...
Output for 5.4.3
Method 1: created 1000 arrays in 0.00074399999999997 microseconds... Method 2: created 1000 arrays in 0.00071900000000003 microseconds...
Output for 5.4.2
Method 1: created 1000 arrays in 0.001018 microseconds... Method 2: created 1000 arrays in 0.00113 microseconds...
Output for 5.4.1
Method 1: created 1000 arrays in 0.00081500000000001 microseconds... Method 2: created 1000 arrays in 0.00083600000000006 microseconds...
Output for 5.3.29
Method 1: created 1000 arrays in 0.00061499999999998 microseconds... Method 2: created 1000 arrays in 0.000694 microseconds...
Output for 5.3.28
Method 1: created 1000 arrays in 0.00066099999999991 microseconds... Method 2: created 1000 arrays in 0.00071900000000003 microseconds...
Output for 5.3.27
Method 1: created 1000 arrays in 0.00064700000000006 microseconds... Method 2: created 1000 arrays in 0.00068500000000005 microseconds...
Output for 5.3.26
Method 1: created 1000 arrays in 0.000649 microseconds... Method 2: created 1000 arrays in 0.00074199999999999 microseconds...
Output for 5.3.25
Method 1: created 1000 arrays in 0.00064999999999993 microseconds... Method 2: created 1000 arrays in 0.00074799999999997 microseconds...
Output for 5.3.24
Method 1: created 1000 arrays in 0.00066500000000003 microseconds... Method 2: created 1000 arrays in 0.00070999999999999 microseconds...
Output for 5.3.23
Method 1: created 1000 arrays in 0.000722 microseconds... Method 2: created 1000 arrays in 0.00078700000000001 microseconds...
Output for 5.3.22
Method 1: created 1000 arrays in 0.00071399999999999 microseconds... Method 2: created 1000 arrays in 0.00082700000000002 microseconds...
Output for 5.3.21
Method 1: created 1000 arrays in 0.00086799999999998 microseconds... Method 2: created 1000 arrays in 0.00097199999999997 microseconds...
Output for 5.3.20
Method 1: created 1000 arrays in 0.00092500000000001 microseconds... Method 2: created 1000 arrays in 0.00099300000000002 microseconds...
Output for 5.3.19
Method 1: created 1000 arrays in 0.00065999999999999 microseconds... Method 2: created 1000 arrays in 0.00073400000000001 microseconds...
Output for 5.3.18
Method 1: created 1000 arrays in 0.001166 microseconds... Method 2: created 1000 arrays in 0.001338 microseconds...