3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = array ( 0 => '2014-06-01 12:45:02' ,1 => '2014-06-01 12:45:03' ,2 => '2014-06-01 12:48:52' ,3 => '2014-06-01 12:50:31' ,4 => '2014-06-01 13:18:49' ,10 => '2014-06-01 13:33:16' ,11 => '2014-06-01 14:20:48' ,12 => '2014-06-01 14:24:44' ,13 => '2014-06-01 15:28:16' ,14 => '2014-06-02 10:50:56' ,15 => '2014-06-02 10:51:07' ,16 => '2014-06-02 18:16:13' ,17 => '2014-06-03 11:20:20' ,18 => '2014-06-03 11:58:46' ,19 => '2014-06-03 11:59:03' ,20 => '2014-06-03 12:00:51' ,21 => '2014-06-03 12:01:21' ,22 => '2014-06-04 19:03:17' ,23 => '2014-06-04 19:06:03' ,24 => '2014-06-04 19:12:03' ,25 => '2014-06-04 21:18:03' ); $start = microtime(true); $new_array = array_map(function($x){return date('Y-m-d', strtotime($x));}, $array); $end = microtime(true); echo $end - $start . "\n"; $start = microtime(true); $new_array = array(); foreach($array as $arr) { $new_array[] = date('Y-m-d', strtotime($arr)); } $end = microtime(true); echo $end - $start . "\n"; //print_r(array_count_values($new_array));
based on R22VE
Output for 7.1.0
0.00010490417480469 7.8201293945312E-5
Output for 7.0.14
0.0001070499420166 8.1062316894531E-5
Output for 7.0.8
8.392333984375E-5 5.4121017456055E-5
Output for 7.0.7
0.00011801719665527 6.8902969360352E-5
Output for 7.0.6
7.7962875366211E-5 5.5074691772461E-5
Output for 7.0.5
0.00010204315185547 6.3180923461914E-5
Output for 7.0.4
7.5101852416992E-5 4.6014785766602E-5
Output for 7.0.3
7.7009201049805E-5 4.9114227294922E-5
Output for 7.0.2
0.0001368522644043 9.7990036010742E-5
Output for 7.0.1
8.6784362792969E-5 6.6995620727539E-5
Output for 7.0.0
9.8943710327148E-5 7.2002410888672E-5
Output for hhvm-3.12.0
0.00040388107299805 0.00019478797912598
Output for hhvm-3.10.0
0.00016689300537109 9.3936920166016E-5
Output for 5.6.28
0.00016283988952637 0.00012016296386719
Output for 5.6.23
0.00010395050048828 6.9856643676758E-5
Output for 5.6.22
0.00026202201843262 0.00020217895507812
Output for 5.6.21
0.00010395050048828 8.1062316894531E-5
Output for 5.6.20
0.00014805793762207 9.7036361694336E-5
Output for 5.6.19
0.00010418891906738 7.2956085205078E-5
Output for 5.6.18
0.00011801719665527 8.2969665527344E-5
Output for 5.6.17
0.00012803077697754 9.8943710327148E-5
Output for 5.6.16
0.00013494491577148 0.00010204315185547
Output for 5.6.15
0.00011181831359863 7.4148178100586E-5
Output for 5.6.14
0.00010800361633301 8.6069107055664E-5
Output for 5.6.13
0.00011706352233887 0.00012493133544922
Output for 5.6.12
0.00014519691467285 9.8943710327148E-5
Output for 5.6.11
0.00013017654418945 8.8930130004883E-5
Output for 5.6.10
0.00012993812561035 0.00011014938354492
Output for 5.6.9
0.00014996528625488 0.00011897087097168
Output for 5.6.8
0.00015902519226074 0.00010919570922852
Output for 5.6.7
9.2029571533203E-5 6.103515625E-5
Output for 5.6.6
0.00012803077697754 0.00010108947753906
Output for 5.6.5
0.00014591217041016 9.6797943115234E-5
Output for 5.6.4
0.00011706352233887 8.0108642578125E-5
Output for 5.6.3
0.00013995170593262 0.00011181831359863
Output for 5.6.2
0.00011491775512695 9.608268737793E-5
Output for 5.6.1
0.00013399124145508 9.2983245849609E-5
Output for 5.6.0
9.3936920166016E-5 6.4849853515625E-5
Output for 5.5.37
9.5844268798828E-5 5.9843063354492E-5
Output for 5.5.36
0.00014114379882812 9.4175338745117E-5
Output for 5.5.35
0.00012087821960449 9.7990036010742E-5
Output for 5.5.34
0.00013208389282227 8.8930130004883E-5
Output for 5.5.33
0.0001220703125 8.1062316894531E-5
Output for 5.5.32
0.00014185905456543 8.1062316894531E-5
Output for 5.5.31
0.00012993812561035 8.8930130004883E-5
Output for 5.5.30
0.00014400482177734 7.7962875366211E-5
Output for 5.5.29
0.0001218318939209 8.6069107055664E-5
Output for 5.5.28
0.00011992454528809 8.5830688476562E-5
Output for 5.5.27
0.00021791458129883 0.0001828670501709
Output for 5.5.26
0.00012898445129395 9.2029571533203E-5
Output for 5.5.25
0.00013113021850586 9.7036361694336E-5
Output for 5.5.24
0.00011110305786133 7.7009201049805E-5
Output for 5.5.23
0.00013589859008789 9.608268737793E-5
Output for 5.5.22
0.00017404556274414 0.00012302398681641
Output for 5.5.21
0.00014781951904297 0.00012493133544922
Output for 5.5.20
0.00019598007202148 0.00010013580322266
Output for 5.5.19
0.00011205673217773 7.6055526733398E-5
Output for 5.5.18
0.00012087821960449 0.00010299682617188
Output for 5.5.16
0.0001227855682373 8.5115432739258E-5
Output for 5.5.15
0.00012016296386719 8.1062316894531E-5
Output for 5.5.14
0.00012087821960449 8.2015991210938E-5
Output for 5.5.13
0.00015711784362793 0.00011205673217773
Output for 5.5.12
0.00011992454528809 9.5844268798828E-5
Output for 5.5.11
0.0001378059387207 9.4175338745117E-5
Output for 5.5.10
0.00014591217041016 0.00010204315185547
Output for 5.5.9
0.00011396408081055 7.9154968261719E-5
Output for 5.5.8
0.00012898445129395 9.1075897216797E-5
Output for 5.5.7
0.00015115737915039 0.00010800361633301
Output for 5.5.6
9.1075897216797E-5 7.2956085205078E-5
Output for 5.5.5
0.0001370906829834 0.00011301040649414
Output for 5.5.4
0.00021195411682129 0.00015711784362793
Output for 5.5.3
0.00012302398681641 8.5115432739258E-5
Output for 5.5.2
0.0002281665802002 0.00018501281738281
Output for 5.5.1
0.00012898445129395 0.00011110305786133
Output for 5.5.0
0.0001518726348877 0.0001060962677002
Output for 5.4.45
0.00010108947753906 8.4161758422852E-5
Output for 5.4.15, 5.4.44
0.00011396408081055 7.7962875366211E-5
Output for 5.4.43
0.00011110305786133 8.7976455688477E-5
Output for 5.4.42
0.00014185905456543 0.00011086463928223
Output for 5.4.41
0.00013303756713867 0.0001070499420166
Output for 5.4.40
0.0001218318939209 8.5115432739258E-5
Output for 5.4.39
9.8943710327148E-5 8.1062316894531E-5
Output for 5.4.25, 5.4.38
0.00015401840209961 0.00010395050048828
Output for 5.4.37
0.0001671314239502 9.608268737793E-5
Output for 5.4.36
0.0001380443572998 9.4890594482422E-5
Output for 5.4.35
0.00012707710266113 7.7009201049805E-5
Output for 5.4.34
0.00014305114746094 9.2029571533203E-5
Output for 5.4.32
0.00015091896057129 0.00010418891906738
Output for 5.4.31
0.00012612342834473 9.1075897216797E-5
Output for 5.4.30
0.00013208389282227 0.00011181831359863
Output for 5.4.29
0.0001380443572998 9.2983245849609E-5
Output for 5.4.28
0.00013208389282227 9.1791152954102E-5
Output for 5.4.27
9.7990036010742E-5 0.00011014938354492
Output for 5.4.26
0.00013613700866699 9.608268737793E-5
Output for 5.4.24
0.00010895729064941 7.2956085205078E-5
Output for 5.4.23
0.00011491775512695 8.2969665527344E-5
Output for 5.4.22
0.00014400482177734 9.7990036010742E-5
Output for 5.4.21
0.00014305114746094 9.7990036010742E-5
Output for 5.4.20
0.00014495849609375 0.00011706352233887
Output for 5.4.19
0.00011205673217773 9.4890594482422E-5
Output for 5.4.18
0.00015497207641602 0.0001070499420166
Output for 5.4.17
0.00012302398681641 0.00010395050048828
Output for 5.4.16
0.0001370906829834 9.3936920166016E-5
Output for 5.4.14
0.00014495849609375 0.00010299682617188
Output for 5.4.13
0.0001521110534668 0.0001070499420166
Output for 5.4.12
0.00014591217041016 0.00010395050048828
Output for 5.4.11
0.00016689300537109 0.00011897087097168
Output for 5.4.10
0.0001370906829834 0.00010108947753906
Output for 5.4.9
0.00017404556274414 0.00013113021850586
Output for 5.4.8
0.00017118453979492 0.00012707710266113
Output for 5.4.7
0.0001680850982666 0.00012397766113281
Output for 5.4.6
0.0001370906829834 0.00011706352233887
Output for 5.4.5
0.00011301040649414 7.3909759521484E-5
Output for 5.4.4
9.918212890625E-5 7.1048736572266E-5
Output for 5.4.3
0.00017309188842773 0.00012493133544922
Output for 5.4.2
0.00010085105895996 7.2956085205078E-5
Output for 5.4.1
0.00015497207641602 0.00012803077697754
Output for 5.4.0
0.00014901161193848 0.00011301040649414
Output for 5.3.19, 5.3.29
0.00017690658569336 0.00014710426330566
Output for 5.3.28
0.00011801719665527 8.6069107055664E-5
Output for 5.3.27
0.00017213821411133 0.00012898445129395
Output for 5.3.26
0.00015997886657715 0.00011491775512695
Output for 5.3.25
0.00014305114746094 0.00012683868408203
Output for 5.3.24
0.0001068115234375 9.2029571533203E-5
Output for 5.3.23
0.00019288063049316 0.00013184547424316
Output for 5.3.22
0.00017690658569336 0.00012803077697754
Output for 5.3.21
0.00017309188842773 0.00014400482177734
Output for 5.3.20
0.00018692016601562 0.00012397766113281
Output for 5.3.18
0.00015401840209961 0.00012397766113281
Output for 5.3.17
0.00017905235290527 0.00013208389282227
Output for 5.3.16
0.00014209747314453 9.5129013061523E-5
Output for 5.3.15
0.00018596649169922 0.00012993812561035
Output for 5.3.14
0.00011086463928223 0.00010585784912109
Output for 5.3.13
0.00015020370483398 0.00011992454528809
Output for 5.3.12
0.00011587142944336 8.7976455688477E-5
Output for 5.3.11
0.00011014938354492 7.6055526733398E-5
Output for 5.3.10
0.00012803077697754 9.3936920166016E-5
Output for 5.3.9
0.00021004676818848 0.0001990795135498
Output for 5.3.8
0.00026607513427734 0.00020003318786621
Output for 5.3.7
0.00025105476379395 0.00017619132995605
Output for 5.3.6
0.00018095970153809 0.00017809867858887
Output for 5.3.5
0.00014996528625488 0.00011920928955078
Output for 5.3.4
0.00017285346984863 0.00012803077697754
Output for 5.3.3
0.00017404556274414 0.00014901161193848
Output for 5.3.2
0.00012683868408203 8.7976455688477E-5
Output for 5.3.1
0.00021219253540039 0.00016403198242188
Output for 5.3.0
0.00016403198242188 0.00012111663818359
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /in/EDeJg on line 28
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION, expecting ')' in /in/EDeJg on line 28
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/EDeJg on line 28
Process exited with code 255.