3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function buildDynamicClass($parent, $child) { $reflection = new ReflectionClass($child); if($reflection->isAbstract()) { $abstract = 'abstract'; } else { $abstract = ''; } eval($abstract.' class '.$parent.' extends '.$child.' { }'); } function buildDynamicClass2($parent, $child) { class_alias($child, $parent); } class A { } $start = microtime(TRUE); for($i=0;$i<10000;$i++) { buildDynamicClass('B'.$i, 'A'); } echo 'buildDynamicClass: '.(microtime(TRUE)-$start); $start = microtime(TRUE); for($i=0;$i<10000;$i++) { buildDynamicClass2('C'.$i, 'A'); } echo 'buildDynamicClass2: '.(microtime(TRUE)-$start);
based on 7BWEL
Output for 7.1.0
buildDynamicClass: 0.056033134460449buildDynamicClass2: 0.0034661293029785
Output for 7.0.14
buildDynamicClass: 0.05535101890564buildDynamicClass2: 0.0036439895629883
Output for 7.0.7
buildDynamicClass: 0.056558847427368buildDynamicClass2: 0.0045580863952637
Output for 7.0.6
buildDynamicClass: 0.05469799041748buildDynamicClass2: 0.0045981407165527
Output for 7.0.5
buildDynamicClass: 0.040771007537842buildDynamicClass2: 0.0040960311889648
Output for 7.0.4
buildDynamicClass: 0.036468029022217buildDynamicClass2: 0.0036411285400391
Output for 7.0.3
buildDynamicClass: 0.048802137374878buildDynamicClass2: 0.0047650337219238
Output for 7.0.2
buildDynamicClass: 0.052383184432983buildDynamicClass2: 0.0050559043884277
Output for 7.0.1
buildDynamicClass: 0.04619312286377buildDynamicClass2: 0.0043509006500244
Output for 7.0.0
buildDynamicClass: 0.050288915634155buildDynamicClass2: 0.0045669078826904
Output for 5.6.28
buildDynamicClass: 0.081432104110718buildDynamicClass2: 0.0069081783294678
Output for 5.6.22
buildDynamicClass: 0.075235843658447buildDynamicClass2: 0.008126974105835
Output for 5.6.21
buildDynamicClass: 0.068959951400757buildDynamicClass2: 0.0080728530883789
Output for 5.6.20
buildDynamicClass: 0.068584203720093buildDynamicClass2: 0.0072650909423828
Output for 5.6.19
buildDynamicClass: 0.075752019882202buildDynamicClass2: 0.0072109699249268
Output for 5.6.18
buildDynamicClass: 0.05815315246582buildDynamicClass2: 0.0067028999328613
Output for 5.6.17
buildDynamicClass: 0.069473028182983buildDynamicClass2: 0.0070090293884277
Output for 5.6.16
buildDynamicClass: 0.071815013885498buildDynamicClass2: 0.0077059268951416
Output for 5.6.15
buildDynamicClass: 0.071746110916138buildDynamicClass2: 0.0079419612884521
Output for 5.6.14
buildDynamicClass: 0.060736894607544buildDynamicClass2: 0.0069069862365723
Output for 5.6.13
buildDynamicClass: 0.047606945037842buildDynamicClass2: 0.0055549144744873
Output for 5.6.12
buildDynamicClass: 0.073873996734619buildDynamicClass2: 0.0075280666351318
Output for 5.6.11
buildDynamicClass: 0.053313016891479buildDynamicClass2: 0.0059871673583984
Output for 5.6.10
buildDynamicClass: 0.075386047363281buildDynamicClass2: 0.0098090171813965
Output for 5.6.9
buildDynamicClass: 0.065656185150146buildDynamicClass2: 0.0063478946685791
Output for 5.6.8
buildDynamicClass: 0.041070938110352buildDynamicClass2: 0.0052130222320557
Output for 5.6.7
buildDynamicClass: 0.057606935501099buildDynamicClass2: 0.00642991065979
Output for 5.6.6
buildDynamicClass: 0.066639184951782buildDynamicClass2: 0.0066850185394287
Output for 5.6.5
buildDynamicClass: 0.10904717445374buildDynamicClass2: 0.017564058303833
Output for 5.6.4
buildDynamicClass: 0.074758052825928buildDynamicClass2: 0.0082459449768066
Output for 5.6.3
buildDynamicClass: 0.070282936096191buildDynamicClass2: 0.0076498985290527
Output for 5.6.2
buildDynamicClass: 0.075645923614502buildDynamicClass2: 0.0078608989715576
Output for 5.6.1
buildDynamicClass: 0.061105012893677buildDynamicClass2: 0.006688117980957
Output for 5.6.0
buildDynamicClass: 0.075031995773315buildDynamicClass2: 0.0072970390319824
Output for 5.5.36
buildDynamicClass: 0.071175098419189buildDynamicClass2: 0.0080161094665527
Output for 5.5.35
buildDynamicClass: 0.065607070922852buildDynamicClass2: 0.0075240135192871
Output for 5.5.34
buildDynamicClass: 0.046694993972778buildDynamicClass2: 0.0056769847869873
Output for 5.5.33
buildDynamicClass: 0.068691968917847buildDynamicClass2: 0.0077419281005859
Output for 5.5.32
buildDynamicClass: 0.060279130935669buildDynamicClass2: 0.0067498683929443
Output for 5.5.31
buildDynamicClass: 0.071359157562256buildDynamicClass2: 0.0073349475860596
Output for 5.5.30
buildDynamicClass: 0.06289005279541buildDynamicClass2: 0.0071768760681152
Output for 5.5.29
buildDynamicClass: 0.067779064178467buildDynamicClass2: 0.0078511238098145
Output for 5.5.28
buildDynamicClass: 0.066230058670044buildDynamicClass2: 0.0080170631408691
Output for 5.5.27
buildDynamicClass: 0.059144020080566buildDynamicClass2: 0.010248184204102
Output for 5.5.26
buildDynamicClass: 0.061494112014771buildDynamicClass2: 0.0070171356201172
Output for 5.5.25
buildDynamicClass: 0.065718173980713buildDynamicClass2: 0.0076179504394531
Output for 5.5.24
buildDynamicClass: 0.068983793258667buildDynamicClass2: 0.0077841281890869
Output for 5.5.23
buildDynamicClass: 0.065237998962402buildDynamicClass2: 0.0067310333251953
Output for 5.5.22
buildDynamicClass: 0.07309103012085buildDynamicClass2: 0.0087192058563232
Output for 5.5.21
buildDynamicClass: 0.050251007080078buildDynamicClass2: 0.0062639713287354
Output for 5.5.20
buildDynamicClass: 0.061864137649536buildDynamicClass2: 0.0069270133972168
Output for 5.5.19
buildDynamicClass: 0.056133985519409buildDynamicClass2: 0.0055170059204102
Output for 5.5.18
buildDynamicClass: 0.064566850662231buildDynamicClass2: 0.0076701641082764
Output for 5.5.16
buildDynamicClass: 0.076318025588989buildDynamicClass2: 0.0086090564727783
Output for 5.5.15
buildDynamicClass: 0.046801090240479buildDynamicClass2: 0.0081498622894287
Output for 5.5.14
buildDynamicClass: 0.078075885772705buildDynamicClass2: 0.0075321197509766
Output for 5.5.13
buildDynamicClass: 0.049973011016846buildDynamicClass2: 0.0063228607177734
Output for 5.5.12
buildDynamicClass: 0.038206815719604buildDynamicClass2: 0.0050549507141113
Output for 5.5.11
buildDynamicClass: 0.05102801322937buildDynamicClass2: 0.0048940181732178
Output for 5.5.10
buildDynamicClass: 0.035722017288208buildDynamicClass2: 0.0050098896026611
Output for 5.5.9
buildDynamicClass: 0.034762859344482buildDynamicClass2: 0.0047750473022461
Output for 5.5.8
buildDynamicClass: 0.030165195465088buildDynamicClass2: 0.0041069984436035
Output for 5.5.7
buildDynamicClass: 0.029464960098267buildDynamicClass2: 0.0041739940643311
Output for 5.5.6
buildDynamicClass: 0.03036904335022buildDynamicClass2: 0.0041542053222656
Output for 5.5.5
buildDynamicClass: 0.040457010269165buildDynamicClass2: 0.0053718090057373
Output for 5.5.4
buildDynamicClass: 0.071161985397339buildDynamicClass2: 0.0074009895324707
Output for 5.5.3
buildDynamicClass: 0.080557823181152buildDynamicClass2: 0.0091829299926758
Output for 5.5.2
buildDynamicClass: 0.063543081283569buildDynamicClass2: 0.007256031036377
Output for 5.5.1
buildDynamicClass: 0.054768085479736buildDynamicClass2: 0.0063629150390625
Output for 5.5.0
buildDynamicClass: 0.074627161026001buildDynamicClass2: 0.0090339183807373
Output for 5.4.45
buildDynamicClass: 0.057060956954956buildDynamicClass2: 0.0060279369354248
Output for 5.4.44
buildDynamicClass: 0.046325922012329buildDynamicClass2: 0.0059530735015869
Output for 5.4.43
buildDynamicClass: 0.056457042694092buildDynamicClass2: 0.0070209503173828
Output for 5.4.42
buildDynamicClass: 0.04366397857666buildDynamicClass2: 0.010355949401855
Output for 5.4.41
buildDynamicClass: 0.046232938766479buildDynamicClass2: 0.0056231021881104
Output for 5.4.40
buildDynamicClass: 0.04996395111084buildDynamicClass2: 0.0059628486633301
Output for 5.4.39
buildDynamicClass: 0.051430940628052buildDynamicClass2: 0.0064342021942139
Output for 5.4.38
buildDynamicClass: 0.049814939498901buildDynamicClass2: 0.0063741207122803
Output for 5.4.37
buildDynamicClass: 0.035181045532227buildDynamicClass2: 0.0050640106201172
Output for 5.4.36
buildDynamicClass: 0.047542095184326buildDynamicClass2: 0.0048830509185791
Output for 5.4.35
buildDynamicClass: 0.04871392250061buildDynamicClass2: 0.0062849521636963
Output for 5.4.34
buildDynamicClass: 0.049224853515625buildDynamicClass2: 0.006181001663208
Output for 5.4.32
buildDynamicClass: 0.053359985351562buildDynamicClass2: 0.0064740180969238
Output for 5.4.31
buildDynamicClass: 0.052697896957397buildDynamicClass2: 0.0059971809387207
Output for 5.4.30
buildDynamicClass: 0.042511940002441buildDynamicClass2: 0.0054080486297607
Output for 5.4.29
buildDynamicClass: 0.041440963745117buildDynamicClass2: 0.0054991245269775
Output for 5.4.28
buildDynamicClass: 0.039704084396362buildDynamicClass2: 0.0051460266113281
Output for 5.4.27
buildDynamicClass: 0.045300006866455buildDynamicClass2: 0.005518913269043
Output for 5.4.26
buildDynamicClass: 0.03569221496582buildDynamicClass2: 0.0041930675506592
Output for 5.4.25
buildDynamicClass: 0.034296989440918buildDynamicClass2: 0.004863977432251
Output for 5.4.24
buildDynamicClass: 0.028451919555664buildDynamicClass2: 0.0039958953857422
Output for 5.4.23
buildDynamicClass: 0.029347896575928buildDynamicClass2: 0.0040559768676758
Output for 5.4.22
buildDynamicClass: 0.029994010925293buildDynamicClass2: 0.0039420127868652
Output for 5.4.21
buildDynamicClass: 0.039447069168091buildDynamicClass2: 0.005277156829834
Output for 5.4.20
buildDynamicClass: 0.048942804336548buildDynamicClass2: 0.0063228607177734
Output for 5.4.19
buildDynamicClass: 0.046289920806885buildDynamicClass2: 0.005605936050415
Output for 5.4.18
buildDynamicClass: 0.056717157363892buildDynamicClass2: 0.0068268775939941
Output for 5.4.17
buildDynamicClass: 0.041769027709961buildDynamicClass2: 0.0052788257598877
Output for 5.4.16
buildDynamicClass: 0.071476936340332buildDynamicClass2: 0.0073740482330322
Output for 5.4.15
buildDynamicClass: 0.050126791000366buildDynamicClass2: 0.0058760643005371
Output for 5.4.14
buildDynamicClass: 0.061012983322144buildDynamicClass2: 0.0071849822998047
Output for 5.4.13
buildDynamicClass: 0.050406932830811buildDynamicClass2: 0.0066118240356445
Output for 5.4.12
buildDynamicClass: 0.043960094451904buildDynamicClass2: 0.0055148601531982
Output for 5.4.11
buildDynamicClass: 0.0471351146698buildDynamicClass2: 0.0059859752655029
Output for 5.4.10
buildDynamicClass: 0.038890838623047buildDynamicClass2: 0.0052189826965332
Output for 5.4.9
buildDynamicClass: 0.05232310295105buildDynamicClass2: 0.0066750049591064
Output for 5.4.8
buildDynamicClass: 0.052016019821167buildDynamicClass2: 0.0063049793243408
Output for 5.4.7
buildDynamicClass: 0.053331136703491buildDynamicClass2: 0.0068490505218506
Output for 5.4.6
buildDynamicClass: 0.048437833786011buildDynamicClass2: 0.0058820247650146
Output for 5.4.5
buildDynamicClass: 0.052172899246216buildDynamicClass2: 0.0063560009002686
Output for 5.4.4
buildDynamicClass: 0.05151891708374buildDynamicClass2: 0.0063509941101074
Output for 5.4.3
buildDynamicClass: 0.054728984832764buildDynamicClass2: 0.0064640045166016
Output for 5.4.2
buildDynamicClass: 0.05504298210144buildDynamicClass2: 0.0065009593963623
Output for 5.4.1
buildDynamicClass: 0.043451070785522buildDynamicClass2: 0.0053620338439941
Output for 5.4.0
buildDynamicClass: 0.048547983169556buildDynamicClass2: 0.0059809684753418