3v4l.org

run code in 300+ PHP versions simultaneously
<?php class inConstruct { function __construct($array) { foreach ($array as $key => $value) { if ($key == 100) { echo "Done"; } } } } class inMethod { function __construct($array) { $this->doThat($array); } function doThat($array){ foreach ($array as $key => $value) { if ($key == 100) { echo "Done"; } } } } $questions = range("a", "z", 1); for($i=0;$i<10;$i++) {} $start = microtime(); ## For inMethod for ($i=0; $i < 1000; $i++) { $m = new inConstruct($questions); unset($m); } echo (microtime() - $start); echo "\n"; $start = microtime(); ## For inConstruct for ($i=0; $i < 1000; $i++) { $m = new inMethod($questions); unset($m); } echo (microtime() - $start);
Output for 7.3.1
Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 0.006096 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 0.001406
Output for 7.3.0
Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 0.00065 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 0.000856
Output for 7.2.13
Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 0.014398 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 0.001183
Output for 7.2.12
Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 0.001296 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 0.001223
Output for 7.2.11
Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 0.001106 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 0.001185
Output for 7.2.10
Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 0.001207 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 0.001096
Output for 7.2.9
Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 0.001413 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 0.001682
Output for 7.2.8
Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 0.000861 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 0.000939
Output for 7.2.7
Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 0.000675 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 0.00077
Output for 7.2.6
Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 0.000809 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 0.000888
Output for 7.2.5
Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 0.000763 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 0.000827
Output for 7.2.4
Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 0.000836 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 0.000894
Output for 7.2.3
Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 0.000644 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 0.000674
Output for 7.2.2
Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 0.000955 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 0.001022
Output for 7.2.1
Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 0.000664 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 0.00068
Output for 7.2.0
Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 0.000791 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 0.000851
Output for 7.1.25
Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 0.033367 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 0.002368
Output for 7.1.7
Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 0.000536 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 0.000556
Output for 7.1.6
Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 0.0011 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 0.001149
Output for 7.1.5
Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 0.001171 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 0.001228
Output for 7.1.0
Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 Notice: A non well formed numeric value encountered in /in/iQDjn on line 41 0.000959 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 Notice: A non well formed numeric value encountered in /in/iQDjn on line 54 0.001038
Output for 7.0.20
0.000909 0.000937
Output for 7.0.14
0.000676 0.000751
Output for 7.0.6
0.00076699999999996 0.00087300000000001
Output for 7.0.5
0.00062900000000002 0.00066800000000003
Output for 7.0.4
0.00076299999999999 0.00079499999999999
Output for 7.0.3
0.00087300000000001 0.0010559999999999
Output for 7.0.2
0.00071599999999999 0.00062299999999998
Output for 7.0.1
0.00084500000000001 0.001039
Output for 7.0.0
0.00080599999999997 0.00083299999999997
Output for 5.6.28
0.003667 0.003831
Output for 5.6.21
0.002968 0.003044
Output for 5.6.20
0.0026170000000001 0.0027469999999999
Output for 5.6.19
0.001793 0.00187
Output for 5.6.18
0.001888 0.001925
Output for 5.6.17
0.001937 0.002002
Output for 5.6.16
0.002378 0.002459
Output for 5.6.15
0.002807 0.002872
Output for 5.6.14
0.002565 0.002675
Output for 5.6.13
0.001802 0.001875
Output for 5.6.12
0.002198 0.002267
Output for 5.6.11
0.002246 0.002364
Output for 5.6.10
0.0023350000000001 0.002433
Output for 5.6.9
0.001773 0.0018710000000001
Output for 5.6.8
0.001789 0.001904
Output for 5.5.35
0.002471 0.002713
Output for 5.5.34
0.003241 0.003425
Output for 5.5.33
0.003416 0.003294
Output for 5.5.32
0.00213 0.0020070000000001
Output for 5.5.31
0.002722 0.0027849999999999
Output for 5.5.30
0.001895 0.002092
Output for 5.5.29
0.002361 0.002446
Output for 5.5.28
0.002315 0.002341
Output for 5.5.27
0.0027400000000001 0.0019939999999999
Output for 5.5.26
0.002015 0.002247
Output for 5.5.25
0.001982 0.0021099999999999
Output for 5.5.24
0.0026930000000001 0.002748
Output for 5.4.45
0.002946 0.0030640000000001
Output for 5.4.44
0.002024 0.002084
Output for 5.4.43
0.0028359999999999 0.002767
Output for 5.4.42
0.001904 0.0019940000000001
Output for 5.4.41
0.003458 0.003521
Output for 5.4.40
0.003185 0.003284
Output for 5.4.39
0.001953 0.002007
Output for 5.4.38
0.001916 0.001963
Output for 5.4.37
0.001956 0.002048
Output for 5.4.36
0.001983 0.002017
Output for 5.4.35
0.001968 0.002026
Output for 5.4.34
0.0019439999999999 0.0020349999999999
Output for 5.4.32
0.0018629999999999 0.00197
Output for 5.4.31
0.001881 0.002026
Output for 5.4.30
0.002723 0.002675
Output for 5.4.29
0.001965 0.002028
Output for 5.4.28
0.0019119999999999 0.0019450000000001
Output for 5.4.27
0.001961 0.002015
Output for 5.4.26
0.0018859999999999 0.001926
Output for 5.4.25
0.002004 0.0020830000000001
Output for 5.4.24
0.002127 0.002037
Output for 5.4.23
0.002055 0.0020509999999999
Output for 5.4.22
0.00193 0.001987
Output for 5.4.21
0.0018819999999999 0.001943
Output for 5.4.20
0.001893 0.001952
Output for 5.4.19
0.002052 0.00254
Output for 5.4.18
0.001941 0.001983
Output for 5.4.17
0.001889 0.001959
Output for 5.4.16
0.0029790000000001 0.002956
Output for 5.4.15
0.001941 0.001929
Output for 5.4.14
0.001982 0.002041
Output for 5.4.13
0.001935 0.001984
Output for 5.4.12
0.002001 0.002108
Output for 5.4.11
0.0019130000000001 0.0019749999999999
Output for 5.4.10
0.001963 0.002214
Output for 5.4.9
0.001921 0.001982
Output for 5.4.8
0.00195 0.001999
Output for 5.4.7
0.001977 0.002024
Output for 5.4.6
0.0019440000000001 0.002012
Output for 5.4.5
0.001935 0.00202
Output for 5.4.4
0.001956 0.002013
Output for 5.4.3
0.001931 0.002005
Output for 5.4.2
0.001945 0.002043
Output for 5.4.1
0.001957 0.002018
Output for 5.4.0
0.001983 0.002062
Output for 5.3.29
0.002247 0.002339
Output for 5.3.28
0.002266 0.002367
Output for 5.3.27
0.003273 0.003824
Output for 5.3.26
0.002266 0.002456
Output for 5.3.25
0.003216 0.003497
Output for 5.3.24
0.002237 0.0023420000000001
Output for 5.3.23
0.002241 0.002342
Output for 5.3.22
0.002285 0.002355
Output for 5.3.21
0.0022759999999999 0.002363
Output for 5.3.20
0.002314 0.002404
Output for 5.3.19
0.002355 0.0024820000000001
Output for 5.3.18
0.002285 0.002387
Output for 5.3.17
0.002209 0.002307
Output for 5.3.16
0.002243 0.002325
Output for 5.3.15
0.002265 0.002342
Output for 5.3.14
0.002185 0.0022789999999999
Output for 5.3.13
0.00238 0.002808
Output for 5.3.12
0.00221 0.002318
Output for 5.3.11
0.002213 0.0023029999999999
Output for 5.3.10
0.00221 0.002392
Output for 5.3.9
0.002297 0.0024459999999999
Output for 5.3.8
0.002185 0.002309
Output for 5.3.7
0.002174 0.0023
Output for 5.3.6
0.00225 0.0023570000000001
Output for 5.3.5
0.00225 0.002374
Output for 5.3.4
0.002208 0.0024700000000001
Output for 5.3.3
0.002234 0.002413
Output for 5.3.2
0.002252 0.0022760000000001
Output for 5.3.1
0.0022990000000001 0.0024169999999999
Output for 5.3.0
0.003753 0.003866
Output for 5.2.17
0.003084 0.0032439999999999
Output for 5.2.16
0.003116 0.00329
Output for 5.2.15
0.005787 0.005927
Output for 5.2.14
0.003178 0.003316
Output for 5.2.13
0.003984 0.005169
Output for 5.2.12
0.003238 0.003389
Output for 5.2.11
0.003046 0.0032059999999999
Output for 5.2.10
0.003128 0.00349
Output for 5.2.9
0.003085 0.00323
Output for 5.2.8
0.004854 0.0053569999999999
Output for 5.2.7
0.003084 0.003218
Output for 5.2.6
0.0029969999999999 0.003171
Output for 5.2.5
0.00461 0.005032
Output for 5.2.4
0.003173 0.003426
Output for 5.2.3
0.002481 0.002618
Output for 5.2.2
0.002377 0.002628
Output for 5.2.1
0.0028170000000001 0.002769
Output for 5.2.0
0.00313 0.003224
Output for 5.1.6
0.003255 0.0033850000000001
Output for 5.1.5
0.0032730000000001 0.0034799999999999
Output for 5.1.4
0.004439 0.004345
Output for 5.1.3
0.003439 0.0036310000000001
Output for 5.1.2
0.003273 0.0034639999999999
Output for 5.1.1
0.004901 0.006038
Output for 5.1.0
0.003317 0.003471
Output for 5.0.5
0.008405 0.008601
Output for 5.0.4
0.009867 0.009865
Output for 5.0.3
0.008709 0.008594
Output for 5.0.2
0.010197 0.009741
Output for 5.0.1
0.012106 0.01318
Output for 5.0.0
0.008047 0.0084610000000001
Output for 4.4.9
Warning: Wrong parameter count for range() in /in/iQDjn on line 29 0.00030200000000002 0.000282
Output for 4.4.8
Warning: Wrong parameter count for range() in /in/iQDjn on line 29 0.00036800000000001 0.00035099999999999
Output for 4.4.7
Warning: Wrong parameter count for range() in /in/iQDjn on line 29 0.00042999999999999 0.00038300000000002
Output for 4.4.6
Warning: Wrong parameter count for range() in /in/iQDjn on line 29 0.000359 0.00033899999999998
Output for 4.4.5
Warning: Wrong parameter count for range() in /in/iQDjn on line 29 0.00030200000000002 0.00028099999999998
Output for 4.4.4
Warning: Wrong parameter count for range() in /in/iQDjn on line 29 0.00031000000000003 0.00029100000000004
Output for 4.4.3
Warning: Wrong parameter count for range() in /in/iQDjn on line 29 0.00035099999999999 0.00034499999999998
Output for 4.4.2
Warning: Wrong parameter count for range() in /in/iQDjn on line 29 0.00029499999999999 0.00029299999999999
Output for 4.4.1
Warning: Wrong parameter count for range() in /in/iQDjn on line 29 0.00035399999999997 0.00040099999999998
Output for 4.4.0
Warning: Wrong parameter count for range() in /in/iQDjn on line 29 0.00055300000000003 0.000278
Output for 4.3.11
Warning: Wrong parameter count for range() in /in/iQDjn on line 29 0.000278 0.00026399999999993
Output for 4.3.10
Warning: Wrong parameter count for range() in /in/iQDjn on line 29 0.000287 0.00027400000000001
Output for 4.3.9
Warning: Wrong parameter count for range() in /in/iQDjn on line 29 0.00028699999999998 0.00027499999999997
Output for 4.3.8
Warning: Wrong parameter count for range() in /in/iQDjn on line 29 0.00030000000000008 0.000282
Output for 4.3.7
Warning: Wrong parameter count for range() in /in/iQDjn on line 29 0.00029900000000005 0.000282
Output for 4.3.6
Warning: Wrong parameter count for range() in /in/iQDjn on line 29 0.000309 0.00029199999999996
Output for 4.3.5
Warning: Wrong parameter count for range() in /in/iQDjn on line 29 0.000297 0.000271
Output for 4.3.4
Warning: Wrong parameter count for range() in /in/iQDjn on line 29 0.00029300000000002 0.00026999999999999
Output for 4.3.3
Warning: Wrong parameter count for range() in /in/iQDjn on line 29 0.00029600000000002 0.00027700000000003
Output for 4.3.2
Warning: Wrong parameter count for range() in /in/iQDjn on line 29 0.00029799999999996 0.00028
Output for 4.3.1
Warning: Wrong parameter count for range() in /in/iQDjn on line 29 0.00028499999999998 0.000274
Output for 4.3.0
Warning: Wrong parameter count for range() in /in/iQDjn on line 29 0.00028399999999995 0.00026999999999999

preferences:
167.97 ms | 401 KiB | 190 Q