3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php namespace yii\db; class test { function formName1() { $class = get_class($this); $pos = strrpos($class, '\\'); return $pos === false ? $class : substr($class, $pos + 1); } function formName2() { $reflector = new \ReflectionClass($this); return $reflector->getShortName(); } } $test = new test; $rounds = 1000000; $start = microtime(true); for($i=0; $i<$rounds; $i++) { $test->formName1(); } echo (microtime(true) - $start); echo "\n"; $start = microtime(true); for($i=0; $i<$rounds; $i++) { $test->formName2(); } echo (microtime(true) - $start);
Output for 7.1.0
0.22363901138306 -0.21144008636475
Output for 7.0.14
0.22593784332275 0.32148694992065
Output for 7.0.6
0.13647198677063 0.32232809066772
Output for 7.0.5
0.14077806472778 0.32387113571167
Output for 7.0.4
0.13942909240723 0.31212592124939
Output for 7.0.3
0.14486908912659 0.31560111045837
Output for 7.0.2
0.13972496986389 0.31126523017883
Output for 7.0.1
0.1706690788269 0.32314682006836
Output for 7.0.0
0.186359167099 0.38573908805847
Output for hhvm-3.12.0
0.57282209396362 1.2339107990265
Output for hhvm-3.10.0
0.83791017532349
Process exited with code 137.
Output for 5.6.28
0.63971900939941 0.51581811904907
Output for 5.6.21
0.47000813484192 0.66743898391724
Output for 5.6.20
0.43638586997986 0.6279559135437
Output for 5.6.19
0.45622086524963 0.67122197151184
Output for 5.6.18
0.40576696395874 0.61513495445251
Output for 5.6.17
0.40370202064514 0.60978293418884
Output for 5.6.16
0.43272495269775 0.6287829875946
Output for 5.6.15
0.42856597900391 0.61794781684875
Output for 5.6.14
0.44540810585022 0.63046312332153
Output for 5.6.13
0.39879488945007 0.63671588897705
Output for 5.6.12
0.40023112297058 0.61901807785034
Output for 5.6.11
0.39710211753845 0.63273215293884
Output for 5.6.10
0.40033316612244 0.61801409721375
Output for 5.6.9
0.42297196388245 0.62575006484985
Output for 5.6.8
0.43424606323242 0.61951518058777
Output for 5.6.7
0.41405892372131 0.60584187507629
Output for 5.6.6
0.43484115600586 0.62154793739319
Output for 5.6.5
0.39548301696777 0.61524486541748
Output for 5.6.4
0.40862107276917 0.62040400505066
Output for 5.6.3
0.44871711730957 0.64270806312561
Output for 5.6.2
0.41790008544922 0.61095595359802
Output for 5.6.1
0.44998288154602 0.66871500015259
Output for 5.6.0
0.42922401428223 0.62290287017822
Output for 5.5.35
0.36604809761047 0.60419392585754
Output for 5.5.34
0.45777606964111 0.63554096221924
Output for 5.5.33
0.4575080871582 0.63734316825867
Output for 5.5.32
0.43177914619446 0.62342405319214
Output for 5.5.31
0.42383003234863 0.63353991508484
Output for 5.5.30
0.47145795822144 0.64287400245667
Output for 5.5.29
0.53327393531799 0.64728808403015
Output for 5.5.28
0.42162084579468 0.62445211410522
Output for 5.5.27
0.42358899116516 0.61887693405151
Output for 5.5.26
0.42207980155945 0.62298893928528
Output for 5.5.25
0.45639896392822 0.6379771232605
Output for 5.5.24
0.44780993461609 0.6346800327301
Output for 5.5.23
0.42299485206604 0.62510204315186
Output for 5.5.22
0.43831181526184 0.631019115448
Output for 5.5.21
0.46913599967957 0.64646601676941
Output for 5.5.20
0.45574903488159 0.63170099258423
Output for 5.5.19
0.45762205123901 0.64045000076294
Output for 5.5.18
0.4592080116272 0.65214705467224
Output for 5.5.16
0.44982600212097 0.64196085929871
Output for 5.5.15
0.42061495780945 0.61833381652832
Output for 5.5.14
0.43412899971008 0.61970090866089
Output for 5.5.13
0.49976992607117 0.72200989723206
Output for 5.5.12
0.4202709197998 0.61975908279419
Output for 5.5.11
0.45973801612854 0.61964297294617
Output for 5.5.10
0.43519687652588 0.65002703666687
Output for 5.5.9
0.45243692398071 0.62495017051697
Output for 5.5.8
0.51979684829712 0.76689505577087
Output for 5.5.7
0.48027682304382 0.63422083854675
Output for 5.5.6
0.4571259021759 0.63089299201965
Output for 5.5.5
0.44178891181946 0.62763094902039
Output for 5.5.4
0.50610899925232 0.70158886909485
Output for 5.5.3
0.4254138469696 0.62267279624939
Output for 5.5.2
0.42068600654602 0.62900018692017
Output for 5.5.1
0.45829510688782 0.63460803031921
Output for 5.5.0
0.51628088951111 0.74048686027527
Output for 5.4.45
0.43241500854492 0.60993480682373
Output for 5.4.44
0.40717315673828 0.60118389129639
Output for 5.4.43
0.43798899650574 0.65676498413086
Output for 5.4.42
0.42076301574707 0.60479998588562
Output for 5.4.41
0.45190000534058 0.63460183143616
Output for 5.4.40
0.42933201789856 0.61178517341614
Output for 5.4.39
0.43015789985657 0.61824297904968
Output for 5.4.38
0.42594408988953 0.60507392883301
Output for 5.4.37
0.41968417167664 0.59922695159912
Output for 5.4.36
0.42204213142395 0.60889005661011
Output for 5.4.35
0.43581295013428 0.61449313163757
Output for 5.4.34
0.44005990028381 0.61245489120483
Output for 5.4.32
0.44137692451477 0.61429500579834
Output for 5.4.31
0.43525195121765 0.63353800773621
Output for 5.4.30
0.4358081817627 0.61313009262085
Output for 5.4.29
0.49102711677551 0.68985891342163
Output for 5.4.28
0.50198698043823 0.60293912887573
Output for 5.4.27
0.40834403038025 0.60108709335327
Output for 5.4.26
0.4875431060791 0.77248001098633
Output for 5.4.25
0.41363286972046 0.60417199134827
Output for 5.4.24
0.4111111164093 0.60578393936157
Output for 5.4.23
0.53875994682312 0.77969217300415
Output for 5.4.22
0.47810697555542 0.6780219078064
Output for 5.4.21
0.43858599662781 0.61558103561401
Output for 5.4.20
0.42935490608215 0.61272287368774
Output for 5.4.19
0.43646788597107 0.61635899543762
Output for 5.4.18
0.4421010017395 0.61304783821106
Output for 5.4.17
0.4609739780426 0.6173779964447
Output for 5.4.16
0.43547201156616 0.61127495765686
Output for 5.4.15
0.4408221244812 0.60525989532471
Output for 5.4.14
0.47683501243591 0.71740007400513
Output for 5.4.13
0.45431208610535 0.61698389053345
Output for 5.4.12
0.43388605117798 0.62510514259338
Output for 5.4.11
0.43648099899292 0.60651683807373
Output for 5.4.10
0.4663770198822 0.66280508041382
Output for 5.4.9
0.46522498130798 0.67146301269531
Output for 5.4.8
0.424644947052 0.60245895385742
Output for 5.4.7
0.42493104934692 0.60357785224915
Output for 5.4.6
0.41371083259583 0.60453391075134
Output for 5.4.5
0.44574785232544 0.61389088630676
Output for 5.4.4
0.43342399597168 0.61031317710876
Output for 5.4.3
0.439288854599 0.61267304420471
Output for 5.4.2
0.42518591880798 0.64510107040405
Output for 5.4.1
0.43908905982971 0.61469006538391
Output for 5.4.0
0.41927599906921 0.6453320980072
Output for 5.3.29
0.74600195884705 0.72688508033752
Output for 5.3.28
0.69261693954468 0.71967196464539
Output for 5.3.27
0.74382996559143 0.7345130443573
Output for 5.3.26
0.84013485908508 0.81242895126343
Output for 5.3.25
0.7749719619751 0.98587608337402
Output for 5.3.24
0.73104786872864 0.74220395088196
Output for 5.3.23
0.73983001708984 0.72386288642883
Output for 5.3.22
0.77798008918762 0.72071003913879
Output for 5.3.21
0.74283003807068 0.72717118263245
Output for 5.3.20
0.8600070476532 0.83612585067749
Output for 5.3.19
0.76758480072021 0.7218861579895
Output for 5.3.18
0.74409890174866 0.7039361000061
Output for 5.3.17
0.9052050113678 0.97318482398987
Output for 5.3.16
0.84505105018616 0.70978188514709
Output for 5.3.15
0.94636201858521 0.91150498390198
Output for 5.3.14
0.75430703163147 0.69402503967285
Output for 5.3.13
0.7542998790741 0.68913912773132
Output for 5.3.12
0.82142996788025 0.72633695602417
Output for 5.3.11
0.75848817825317 0.69411301612854
Output for 5.3.10
0.78951501846313 0.72225403785706
Output for 5.3.9
0.75359702110291 0.69590902328491
Output for 5.3.8
0.8337140083313 0.78000402450562
Output for 5.3.7
0.75297713279724 0.69386792182922
Output for 5.3.6
0.72776699066162 0.69704103469849
Output for 5.3.5
0.84540390968323 0.78121900558472
Output for 5.3.4
0.83544111251831 0.8321578502655
Output for 5.3.3
0.7261369228363 0.69074416160583
Output for 5.3.2
0.81201791763306 0.75509810447693
Output for 5.3.1
0.80995416641235 0.76402711868286
Output for 5.3.0
0.75152611732483 0.66647291183472
Output for 5.2.3 - 5.2.17
Parse error: syntax error, unexpected T_STRING in /in/qbPNj on line 2
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.2
<br /> <b>Parse error</b>: syntax error, unexpected T_STRING in <b>/in/qbPNj</b> on line <b>2</b><br />
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
<br /> <b>Parse error</b>: parse error, unexpected T_STRING in <b>/in/qbPNj</b> on line <b>2</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.3.4
<br /> <b>Parse error</b>: parse error in <b>/in/qbPNj</b> on line <b>2</b><br />
Process exited with code 255.