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 = 1000; $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.00017118453979492 0.00023603439331055
Output for 7.0.14
0.00035595893859863 0.00047087669372559
Output for 7.0.7
0.00025105476379395 0.00059914588928223
Output for 7.0.6
0.00024986267089844 0.0005640983581543
Output for 7.0.5
0.00022387504577637 0.00059103965759277
Output for 7.0.4
0.00020694732666016 0.00051093101501465
Output for 7.0.3
0.00020503997802734 0.00044798851013184
Output for 7.0.2
0.00026416778564453 0.00056600570678711
Output for 7.0.1
0.00023603439331055 0.00050616264343262
Output for 7.0.0
0.00024199485778809 0.00055789947509766
Output for 5.6.22
0.00067687034606934 0.00089883804321289
Output for 5.6.21
0.00073504447937012 0.0010900497436523
Output for 5.6.20
0.0004570484161377 0.00070309638977051
Output for 5.6.19
0.00051498413085938 0.0007781982421875
Output for 5.6.18
0.00072789192199707 0.0011789798736572
Output for 5.6.17
0.00068211555480957 0.0011639595031738
Output for 5.6.16
0.0005650520324707 0.00089597702026367
Output for 5.6.15
0.00054788589477539 0.0008242130279541
Output for 5.6.14
0.00045895576477051 0.00064206123352051
Output for 5.6.13
0.00041604042053223 0.00063705444335938
Output for 5.6.12
0.00065398216247559 0.0010099411010742
Output for 5.6.11
0.00068092346191406 0.0010550022125244
Output for 5.6.10
0.00067996978759766 0.0010480880737305
Output for 5.6.9
0.00057697296142578 0.00092697143554688
Output for 5.6.8
0.00068998336791992 0.0010378360748291
Output for 5.6.7
0.00066184997558594 0.00095605850219727
Output for 5.6.6
0.00072407722473145 0.0011060237884521
Output for 5.6.5
0.00058197975158691 0.00095796585083008
Output for 5.6.4
0.00067400932312012 0.0010528564453125
Output for 5.6.3
0.00052404403686523 0.00087499618530273
Output for 5.6.2
0.00052213668823242 0.00081014633178711
Output for 5.6.1
0.0006709098815918 0.0010430812835693
Output for 5.6.0
0.00071191787719727 0.0011208057403564
Output for 5.5.36
0.00058507919311523 0.00084185600280762
Output for 5.5.35
0.00066113471984863 0.00097203254699707
Output for 5.5.34
0.0007481575012207 0.0011539459228516
Output for 5.5.33
0.00078511238098145 0.0010921955108643
Output for 5.5.32
0.00043797492980957 0.00064516067504883
Output for 5.5.31
0.00075316429138184 0.0012118816375732
Output for 5.5.30
0.0004580020904541 0.00064897537231445
Output for 5.5.29
0.00059795379638672 0.00088310241699219
Output for 5.5.28
0.00071907043457031 0.001072883605957
Output for 5.5.27
0.00046920776367188 0.00072503089904785
Output for 5.5.26
0.00072693824768066 0.0010559558868408
Output for 5.5.25
0.00071597099304199 0.0013301372528076
Output for 5.5.24
0.00075101852416992 0.0011091232299805
Output for 5.5.23
0.00075316429138184 0.0010929107666016
Output for 5.5.22
0.00062108039855957 0.0009160041809082
Output for 5.5.21
0.00078797340393066 0.0011539459228516
Output for 5.5.20
0.00071191787719727 0.0010969638824463
Output for 5.5.19
0.00059103965759277 0.00075006484985352
Output for 5.5.18
0.00065183639526367 0.0010380744934082
Output for 5.5.16
0.0007331371307373 0.0010659694671631
Output for 5.5.15
0.00077700614929199 0.0011179447174072
Output for 5.5.14
0.00071597099304199 0.0010669231414795
Output for 5.5.13
0.00075602531433105 0.0011310577392578
Output for 5.5.12
0.00076794624328613 0.0010850429534912
Output for 5.5.11
0.00075078010559082 0.0011250972747803
Output for 5.5.10
0.0007781982421875 0.0011160373687744
Output for 5.5.9
0.0007479190826416 0.001121997833252
Output for 5.5.8
0.00076413154602051 0.0011141300201416
Output for 5.5.7
0.00072503089904785 0.0011641979217529
Output for 5.5.6
0.00069499015808105 0.0010180473327637
Output for 5.5.5
0.00080609321594238 0.0011241436004639
Output for 5.5.4
0.00067996978759766 0.0009608268737793
Output for 5.5.3
0.00085616111755371 0.0011770725250244
Output for 5.5.2
0.00072193145751953 0.0010850429534912
Output for 5.5.1
0.00044512748718262 0.00064492225646973
Output for 5.5.0
0.0008549690246582 0.0012989044189453
Output for 5.4.45
0.0006711483001709 0.0010199546813965
Output for 5.4.44
0.00055789947509766 0.00078582763671875
Output for 5.4.43
0.0006718635559082 0.0009300708770752
Output for 5.4.42
0.0005800724029541 0.00085902214050293
Output for 5.4.41
0.00066804885864258 0.00098991394042969
Output for 5.4.40
0.0007319450378418 0.0010991096496582
Output for 5.4.39
0.00054407119750977 0.0008389949798584
Output for 5.4.38
0.0007479190826416 0.0010538101196289
Output for 5.4.37
0.00073695182800293 0.0013151168823242
Output for 5.4.36
0.00049805641174316 0.00073504447937012
Output for 5.4.35
0.00077700614929199 0.001147985458374
Output for 5.4.34
0.00074601173400879 0.0010771751403809
Output for 5.4.32
0.00073099136352539 0.0010972023010254
Output for 5.4.31
0.00073599815368652 0.0010919570922852
Output for 5.4.30
0.00073599815368652 0.0011031627655029
Output for 5.4.29
0.00075006484985352 0.0010840892791748
Output for 5.4.28
0.00052595138549805 0.00078010559082031
Output for 5.4.27
0.0007789134979248 0.0011529922485352
Output for 5.4.26
0.00064301490783691 0.00094389915466309
Output for 5.4.25
0.00073599815368652 0.0010929107666016
Output for 5.4.24
0.00073790550231934 0.0010881423950195
Output for 5.4.23
0.00075197219848633 0.0011770725250244
Output for 5.4.22
0.00080704689025879 0.0011589527130127
Output for 5.4.21
0.00089001655578613 0.0012831687927246
Output for 5.4.20
0.00072288513183594 0.0010950565338135
Output for 5.4.19
0.00049996376037598 0.00073695182800293
Output for 5.4.18
0.00078296661376953 0.0011119842529297
Output for 5.4.17
0.00060820579528809 0.00083208084106445
Output for 5.4.16
0.00066399574279785 0.0010271072387695
Output for 5.4.15
0.00065803527832031 0.00096607208251953
Output for 5.4.14
0.0007169246673584 0.0010640621185303
Output for 5.4.13
0.00054407119750977 0.00083613395690918
Output for 5.4.12
0.00066399574279785 0.00099301338195801
Output for 5.4.11
0.0005190372467041 0.00076603889465332
Output for 5.4.10
0.00069904327392578 0.0010650157928467
Output for 5.4.9
0.00079107284545898 0.0011911392211914
Output for 5.4.8
0.00063681602478027 0.00096797943115234
Output for 5.4.7
0.00076794624328613 0.0010979175567627
Output for 5.4.6
0.00075006484985352 0.0012140274047852
Output for 5.4.5
0.0005040168762207 0.00077414512634277
Output for 5.4.4
0.0007469654083252 0.0010678768157959
Output for 5.4.3
0.00076007843017578 0.0014619827270508
Output for 5.4.2
0.00072598457336426 0.0011241436004639
Output for 5.4.1
0.00064492225646973 0.00098085403442383
Output for 5.4.0
0.00067901611328125 0.0010080337524414
Output for 5.3.29
0.001060962677002 0.001107931137085
Output for 5.3.28
0.00099587440490723 0.0010230541229248
Output for 5.3.27
0.0013010501861572 0.0013179779052734
Output for 5.3.26
0.0012791156768799 0.0013399124145508
Output for 5.3.25
0.0012309551239014 0.0012800693511963
Output for 5.3.24
0.001046895980835 0.0010700225830078
Output for 5.3.23
0.001054048538208 0.0011532306671143
Output for 5.3.22
0.00076103210449219 0.00089693069458008
Output for 5.3.21
0.001284122467041 0.0013058185577393
Output for 5.3.20
0.0013442039489746 0.0013530254364014
Output for 5.3.19
0.001737117767334 0.0025351047515869
Output for 5.3.18
0.0012598037719727 0.0011169910430908
Output for 5.3.17
0.00082492828369141 0.0008552074432373
Output for 5.3.16
0.00099396705627441 0.00098800659179688
Output for 5.3.15
0.00096797943115234 0.0010299682617188
Output for 5.3.14
0.001291036605835 0.001255989074707
Output for 5.3.13
0.001248836517334 0.0011811256408691
Output for 5.3.12
0.0010559558868408 0.0010240077972412
Output for 5.3.11
0.0010941028594971 0.00095295906066895
Output for 5.3.10
0.0007479190826416 0.00076508522033691
Output for 5.3.9
0.0013899803161621 0.0012209415435791
Output for 5.3.8
0.0013411045074463 0.0013139247894287
Output for 5.3.7
0.0010840892791748 0.0011639595031738
Output for 5.3.6
0.00073909759521484 0.00075411796569824
Output for 5.3.5
0.0012209415435791 0.0011918544769287
Output for 5.3.4
0.0011811256408691 0.0010778903961182
Output for 5.3.3
0.0012819766998291 0.0011270046234131
Output for 5.3.2
0.0013079643249512 0.0011870861053467
Output for 5.3.1
0.00087213516235352 0.00080299377441406
Output for 5.3.0
0.0010569095611572 0.00099515914916992
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_STRING in /in/3ulMW on line 2
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_STRING in /in/3ulMW on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/3ulMW on line 2
Process exited with code 255.