3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $x = 129; $i = 1; $y = 1; $m = microtime(true); for ($i = 1; $i <= 1000; ++$i){ $y = 1 << ceil(log($x, 2)); } echo microtime(true) - $m, "\n\r"; $y = 1; $m = microtime(true); for ($i = 1; $i <= 1000; ++$i){ while ($y < $x) { $y = $y <<1; } } echo microtime(true) - $m, "\n\r";
Output for 7.1.0
0.00020194053649902 1.0013580322266E-5
Output for 7.0.14
0.00034499168395996 1.6927719116211E-5
Output for 7.0.10
0.0002739429473877 1.1920928955078E-5
Output for 7.0.9
0.00028705596923828 1.0013580322266E-5
Output for 7.0.8
0.00026702880859375 1.2874603271484E-5
Output for 7.0.7
0.00030612945556641 1.215934753418E-5
Output for 7.0.6
0.00036096572875977 2.3126602172852E-5
Output for 7.0.5
0.00027799606323242 1.2874603271484E-5
Output for 7.0.4
0.00040292739868164 1.8119812011719E-5
Output for 7.0.3
0.00033402442932129 1.8835067749023E-5
Output for 7.0.2
0.00034594535827637 1.5020370483398E-5
Output for 7.0.1
0.00031900405883789 1.6212463378906E-5
Output for 7.0.0
0.0003049373626709 1.1920928955078E-5
Output for hhvm-3.12.0
0.00033211708068848 8.392333984375E-5
Output for hhvm-3.10.0
0.00049209594726562 0.0001530647277832
Output for 5.6.28
0.0007171630859375 4.1961669921875E-5
Output for 5.6.25
0.0004889965057373 3.6001205444336E-5
Output for 5.6.24
0.0005800724029541 4.887580871582E-5
Output for 5.6.23
0.00052905082702637 4.9829483032227E-5
Output for 5.6.22
0.00053215026855469 3.9815902709961E-5
Output for 5.6.21
0.00058293342590332 4.4107437133789E-5
Output for 5.6.20
0.00053906440734863 4.0054321289062E-5
Output for 5.6.19
0.00059604644775391 5.9127807617188E-5
Output for 5.6.18
0.0003669261932373 2.598762512207E-5
Output for 5.6.17
0.00054407119750977 3.8862228393555E-5
Output for 5.6.16
0.00053215026855469 3.8862228393555E-5
Output for 5.6.15
0.00053501129150391 3.9100646972656E-5
Output for 5.6.14
0.00036787986755371 2.6941299438477E-5
Output for 5.6.13
0.00051999092102051 3.4093856811523E-5
Output for 5.6.12
0.00049495697021484 3.6001205444336E-5
Output for 5.6.11
0.00053000450134277 3.7908554077148E-5
Output for 5.6.10
0.00058817863464355 4.8160552978516E-5
Output for 5.6.9
0.0005040168762207 4.9114227294922E-5
Output for 5.6.8
0.00056290626525879 4.1007995605469E-5
Output for 5.6.7
0.00062108039855957 4.3869018554688E-5
Output for 5.6.6
0.00061702728271484 6.0081481933594E-5
Output for 5.6.5
0.00049591064453125 3.6954879760742E-5
Output for 5.6.4
0.0005340576171875 4.0054321289062E-5
Output for 5.6.3
0.0006258487701416 4.5061111450195E-5
Output for 5.6.2
0.00076699256896973 5.4121017456055E-5
Output for 5.6.1
0.00057291984558105 5.3882598876953E-5
Output for 5.6.0
0.00061297416687012 4.4822692871094E-5
Output for 5.5.38
0.00051093101501465 4.2915344238281E-5
Output for 5.5.37
0.00041913986206055 2.8848648071289E-5
Output for 5.5.36
0.00060510635375977 4.4107437133789E-5
Output for 5.5.35
0.00052094459533691 3.7908554077148E-5
Output for 5.5.34
0.00053787231445312 3.8862228393555E-5
Output for 5.5.33
0.00055503845214844 3.9815902709961E-5
Output for 5.5.32
0.00089001655578613 6.2942504882812E-5
Output for 5.5.31
0.00052404403686523 3.7908554077148E-5
Output for 5.5.30
0.00060105323791504 5.4121017456055E-5
Output for 5.5.29
0.00055694580078125 4.0054321289062E-5
Output for 5.5.28
0.00045895576477051 3.3140182495117E-5
Output for 5.5.27
0.00054287910461426 6.103515625E-5
Output for 5.5.26
0.00053501129150391 3.814697265625E-5
Output for 5.5.25
0.00057101249694824 4.1007995605469E-5
Output for 5.5.24
0.0005948543548584 4.2915344238281E-5
Output for 5.5.23
0.00055909156799316 4.1007995605469E-5
Output for 5.5.22
0.00059390068054199 4.2915344238281E-5
Output for 5.5.21
0.00053000450134277 4.5061111450195E-5
Output for 5.5.20
0.00054812431335449 3.8862228393555E-5
Output for 5.5.19
0.00083708763122559 5.4121017456055E-5
Output for 5.5.18
0.00060105323791504 4.2915344238281E-5
Output for 5.5.16
0.00090789794921875 6.3180923461914E-5
Output for 5.5.15
0.00059700012207031 4.3153762817383E-5
Output for 5.5.14
0.00063896179199219 4.6014785766602E-5
Output for 5.5.13
0.00061202049255371 4.4107437133789E-5
Output for 5.5.12
0.00064206123352051 4.6014785766602E-5
Output for 5.5.11
0.00088381767272949 5.4836273193359E-5
Output for 5.5.10
0.00045204162597656 3.2901763916016E-5
Output for 5.5.9
0.00069808959960938 4.887580871582E-5
Output for 5.5.8
0.00056910514831543 4.1961669921875E-5
Output for 5.5.7
0.00054311752319336 3.8862228393555E-5
Output for 5.5.6
0.00054597854614258 4.3153762817383E-5
Output for 5.5.5
0.00038814544677734 2.7894973754883E-5
Output for 5.5.4
0.00047087669372559 3.4093856811523E-5
Output for 5.5.3
0.00069499015808105 4.9829483032227E-5
Output for 5.5.2
0.00062012672424316 4.3869018554688E-5
Output for 5.5.1
0.0005800724029541 4.1961669921875E-5
Output for 5.5.0
0.00075316429138184 3.6954879760742E-5
Output for 5.4.45
0.00049185752868652 4.3869018554688E-5
Output for 5.4.44
0.0005180835723877 3.814697265625E-5
Output for 5.4.43
0.0005948543548584 4.1007995605469E-5
Output for 5.4.42
0.00057792663574219 4.1007995605469E-5
Output for 5.4.41
0.00045895576477051 3.6954879760742E-5
Output for 5.4.40
0.00053811073303223 5.2928924560547E-5
Output for 5.4.39
0.00057291984558105 4.1007995605469E-5
Output for 5.4.38
0.00061321258544922 4.2915344238281E-5
Output for 5.4.37
0.0005948543548584 4.1961669921875E-5
Output for 5.4.36
0.00057005882263184 4.1007995605469E-5
Output for 5.4.35
0.00060486793518066 4.2915344238281E-5
Output for 5.4.34
0.00054311752319336 4.3153762817383E-5
Output for 5.4.32
0.00052404403686523 5.1021575927734E-5
Output for 5.4.31
0.00049400329589844 4.1007995605469E-5
Output for 5.4.30
0.00067996978759766 3.4093856811523E-5
Output for 5.4.29
0.00062012672424316 4.887580871582E-5
Output for 5.4.28
0.00046181678771973 3.3140182495117E-5
Output for 5.4.27
0.00047421455383301 3.8862228393555E-5
Output for 5.4.26
0.00062704086303711 5.1975250244141E-5
Output for 5.4.25
0.0010159015655518 6.3180923461914E-5
Output for 5.4.24
0.00053620338439941 4.887580871582E-5
Output for 5.4.23
0.0006248950958252 4.3153762817383E-5
Output for 5.4.22
0.00062799453735352 4.5061111450195E-5
Output for 5.4.21
0.00056791305541992 5.2928924560547E-5
Output for 5.4.20
0.00056695938110352 4.9114227294922E-5
Output for 5.4.19
0.00055909156799316 3.8862228393555E-5
Output for 5.4.18
0.00079798698425293 5.5074691772461E-5
Output for 5.4.17
0.00064587593078613 4.4822692871094E-5
Output for 5.4.16
0.00055503845214844 5.2928924560547E-5
Output for 5.4.15
0.00054001808166504 5.6982040405273E-5
Output for 5.4.14
0.0005950927734375 5.4121017456055E-5
Output for 5.4.13
0.00048589706420898 3.3855438232422E-5
Output for 5.4.12
0.00063014030456543 4.6014785766602E-5
Output for 5.4.11
0.00059008598327637 4.4107437133789E-5
Output for 5.4.10
0.00050497055053711 3.504753112793E-5
Output for 5.4.9
0.00059413909912109 4.6014785766602E-5
Output for 5.4.8
0.0005190372467041 3.6954879760742E-5
Output for 5.4.7
0.00047492980957031 3.4093856811523E-5
Output for 5.4.6
0.0006260871887207 5.8889389038086E-5
Output for 5.4.5
0.00062704086303711 4.5061111450195E-5
Output for 5.4.4
0.0005640983581543 5.1021575927734E-5
Output for 5.4.3
0.00061392784118652 4.6014785766602E-5
Output for 5.4.2
0.00057792663574219 3.9815902709961E-5
Output for 5.4.1
0.00055098533630371 4.887580871582E-5
Output for 5.4.0
0.0010237693786621 6.2227249145508E-5
Output for 5.3.29
0.00058293342590332 5.0067901611328E-5
Output for 5.3.28
0.0011351108551025 9.0122222900391E-5
Output for 5.3.27
0.00059103965759277 4.6968460083008E-5
Output for 5.3.26
0.00066709518432617 6.3896179199219E-5
Output for 5.3.25
0.00061893463134766 5.3882598876953E-5
Output for 5.3.24
0.00094294548034668 5.6028366088867E-5
Output for 5.3.23
0.0006721019744873 6.9141387939453E-5
Output for 5.3.22
0.00054812431335449 6.1988830566406E-5
Output for 5.3.21
0.0006248950958252 5.2928924560547E-5
Output for 5.3.20
0.00066304206848145 7.7009201049805E-5
Output for 5.3.19
0.00070285797119141 6.1988830566406E-5
Output for 5.3.18
0.00064182281494141 5.6982040405273E-5
Output for 5.3.17
0.00054502487182617 4.7922134399414E-5
Output for 5.3.16
0.00062894821166992 5.8174133300781E-5
Output for 5.3.15
0.00065493583679199 7.0810317993164E-5
Output for 5.3.14
0.00067305564880371 5.8174133300781E-5
Output for 5.3.13
0.00070595741271973 5.793571472168E-5
Output for 5.3.12
0.00067615509033203 5.4121017456055E-5
Output for 5.3.11
0.00070309638977051 6.7949295043945E-5
Output for 5.3.10
0.00055193901062012 4.9114227294922E-5
Output for 5.3.9
0.00066208839416504 5.8889389038086E-5
Output for 5.3.8
0.00069618225097656 6.1988830566406E-5
Output for 5.3.7
0.00066304206848145 6.0081481933594E-5
Output for 5.3.6
0.00075292587280273 6.6995620727539E-5
Output for 5.3.5
0.0006709098815918 5.9127807617188E-5
Output for 5.3.4
0.00053691864013672 5.6982040405273E-5
Output for 5.3.3
0.0006260871887207 5.6982040405273E-5
Output for 5.3.2
0.00063920021057129 6.103515625E-5
Output for 5.3.1
0.00052881240844727 4.6968460083008E-5
Output for 5.3.0
0.00048613548278809 5.6982040405273E-5
Output for 5.2.17
0.00069403648376465 9.3936920166016E-5
Output for 5.2.16
0.00053501129150391 6.7949295043945E-5
Output for 5.2.15
0.00078701972961426 0.00010204315185547
Output for 5.2.14
0.00075602531433105 9.8943710327148E-5
Output for 5.2.13
0.00078105926513672 0.00011014938354492
Output for 5.2.12
0.00080084800720215 0.00010919570922852
Output for 5.2.11
0.00071501731872559 7.2956085205078E-5
Output for 5.2.10
0.00056219100952148 6.9856643676758E-5
Output for 5.2.9
0.00070500373840332 0.00010204315185547
Output for 5.2.8
0.00075101852416992 0.00011110305786133
Output for 5.2.7
0.00070905685424805 0.00010895729064941
Output for 5.2.6
0.00058197975158691 7.8916549682617E-5
Output for 5.2.5
0.00073695182800293 9.5129013061523E-5
Output for 5.2.4
0.00069904327392578 9.2983245849609E-5
Output for 5.2.3
0.00067591667175293 9.0122222900391E-5
Output for 5.2.2
0.00073909759521484 0.00011086463928223
Output for 5.2.1
0.0007939338684082 8.8930130004883E-05
Output for 5.2.0
0.00074195861816406 9.2983245849609E-05
Output for 5.1.6
0.0009160041809082 8.1062316894531E-05
Output for 5.1.5
0.00046014785766602 7.7962875366211E-05
Output for 5.1.4
0.00068306922912598 9.3936920166016E-05
Output for 5.1.3
0.00079607963562012 8.5115432739258E-05
Output for 5.1.2
0.0006868839263916 0.00010299682617188
Output for 5.1.1
0.0005800724029541 7.9870223999023E-05
Output for 5.1.0
0.00056576728820801 0.00011706352233887
Output for 5.0.5
0.0009610652923584 0.00024199485778809
Output for 5.0.4
0.0010669231414795 0.00026798248291016
Output for 5.0.3
0.0013549327850342 0.00031781196594238
Output for 5.0.2
0.00097298622131348 0.00024795532226562
Output for 5.0.1
0.0012490749359131 0.00037813186645508
Output for 5.0.0
0.00088119506835938 0.00024294853210449
Output for 4.4.9
0.001067 0.00027
Output for 4.4.8
0.001272 0.000432
Output for 4.4.7
0.001125 0.000272
Output for 4.4.6
0.000876 0.000164
Output for 4.4.5
0.001021 0.000246
Output for 4.4.4
0.000953 0.00024
Output for 4.4.3
0.000721 0.000172
Output for 4.4.2
0.001055 0.000315
Output for 4.4.1
0.001235 0.000273
Output for 4.4.0
0.000898 0.000248
Output for 4.3.11
0.000803 0.000183
Output for 4.3.10
0.001124 0.000291
Output for 4.3.9
0.001072 0.000284
Output for 4.3.8
0.000628 0.000159
Output for 4.3.7
0.001093 0.000289
Output for 4.3.6
0.001031 0.000262
Output for 4.3.5
0.001089 0.000278
Output for 4.3.4
0.000885 0.000214
Output for 4.3.3
0.000964 0.000235
Output for 4.3.2
0.00079 0.00021
Output for 4.3.1
0.001001 0.000242
Output for 4.3.0
0.000717 0.000178