run code in 150+ php & hhvm versions
Bugs & Features
<?php class A { private $_field = "abcdefghijklmnopqrstuvwxyz"; public function __get($name) {} } class B { public $_field = "abcdefghijklmnopqrstuvwxyz"; } $a = new A; $start = microtime(true); for ($i = 0; $i < 100000; $i++) $field = $a->_field; $time_taken = microtime(true) - $start; echo 'With get: ' . $time_taken . 's' . PHP_EOL; $b = new B; $start = microtime(true); for ($i = 0; $i < 100000; $i++) $field = $b->_field; $time_taken = microtime(true) - $start; echo 'Without get: ' . $time_taken . 's' . PHP_EOL;
Output for 7.1.0
With get: 0.014287948608398s Without get: 0.0028030872344971s
Output for 7.0.14
With get: 0.014219045639038s Without get: 0.0026769638061523s
Output for 7.0.6
With get: 0.01236891746521s Without get: 0.0021140575408936s
Output for 7.0.5
With get: 0.011779069900513s Without get: 0.0024020671844482s
Output for 7.0.4
With get: 0.014065980911255s Without get: 0.0027568340301514s
Output for 7.0.3
With get: 0.00984787940979s Without get: 0.0018191337585449s
Output for 7.0.2
With get: 0.012861013412476s Without get: 0.0024468898773193s
Output for 7.0.1
With get: 0.014105796813965s Without get: 0.0030040740966797s
Output for 7.0.0
With get: 0.01264500617981s Without get: 0.002277135848999s
Output for hhvm-3.12.0
With get: 0.014842987060547s Without get: 0.0069510936737061s
Output for hhvm-3.10.0
With get: 0.016465902328491s Without get: 0.0083611011505127s
Output for 5.6.28
With get: 0.032305002212524s Without get: 0.0079569816589355s
Output for 5.6.21
With get: 0.025249004364014s Without get: 0.0053188800811768s
Output for 5.6.20
With get: 0.018251180648804s Without get: 0.0040459632873535s
Output for 5.6.19
With get: 0.02553915977478s Without get: 0.0053839683532715s
Output for 5.6.18
With get: 0.018297910690308s Without get: 0.0040619373321533s
Output for 5.6.17
With get: 0.025016069412231s Without get: 0.0052750110626221s
Output for 5.6.16
With get: 0.018805980682373s Without get: 0.0040488243103027s
Output for 5.6.15
With get: 0.018319845199585s Without get: 0.0040268898010254s
Output for 5.6.14
With get: 0.018440961837769s Without get: 0.0041720867156982s
Output for 5.6.13
With get: 0.023798942565918s Without get: 0.0051121711730957s
Output for 5.6.12
With get: 0.020052909851074s Without get: 0.0042510032653809s
Output for 5.6.11
With get: 0.020687818527222s Without get: 0.0044398307800293s
Output for 5.6.10
With get: 0.018610000610352s Without get: 0.0041160583496094s
Output for 5.6.9
With get: 0.025938987731934s Without get: 0.0053548812866211s
Output for 5.6.8
With get: 0.026041030883789s Without get: 0.0051178932189941s
Output for 5.6.7
With get: 0.024521827697754s Without get: 0.0051670074462891s
Output for 5.6.6
With get: 0.01944899559021s Without get: 0.004249095916748s
Output for 5.6.5
With get: 0.028349161148071s Without get: 0.0059530735015869s
Output for 5.6.4
With get: 0.02726411819458s Without get: 0.0056710243225098s
Output for 5.6.3
With get: 0.022388935089111s Without get: 0.0049099922180176s
Output for 5.6.2
With get: 0.018402814865112s Without get: 0.0040781497955322s
Output for 5.6.1
With get: 0.027755975723267s Without get: 0.0066177845001221s
Output for 5.6.0
With get: 0.023993015289307s Without get: 0.0049629211425781s
Output for 5.5.35
With get: 0.018707990646362s Without get: 0.0042309761047363s
Output for 5.5.34
With get: 0.025804042816162s Without get: 0.0056869983673096s
Output for 5.5.33
With get: 0.026564836502075s Without get: 0.005864143371582s
Output for 5.5.32
With get: 0.021891832351685s Without get: 0.0045549869537354s
Output for 5.5.31
With get: 0.028833866119385s Without get: 0.0061309337615967s
Output for 5.5.30
With get: 0.024070024490356s Without get: 0.005295991897583s
Output for 5.5.29
With get: 0.025650024414062s Without get: 0.0056638717651367s
Output for 5.5.28
With get: 0.022810935974121s Without get: 0.0050640106201172s
Output for 5.5.27
With get: 0.026925086975098s Without get: 0.005918025970459s
Output for 5.5.26
With get: 0.026287794113159s Without get: 0.0048940181732178s
Output for 5.5.25
With get: 0.023858070373535s Without get: 0.0054199695587158s
Output for 5.5.24
With get: 0.026418924331665s Without get: 0.0057930946350098s
Output for 5.5.23
With get: 0.026766061782837s Without get: 0.0061750411987305s
Output for 5.5.22
With get: 0.017907857894897s Without get: 0.0041320323944092s
Output for 5.5.21
With get: 0.025608062744141s Without get: 0.0056109428405762s
Output for 5.5.20
With get: 0.021631956100464s Without get: 0.0050089359283447s
Output for 5.5.19
With get: 0.026571035385132s Without get: 0.005824089050293s
Output for 5.5.18
With get: 0.02501392364502s Without get: 0.0054469108581543s
Output for 5.5.16
With get: 0.017764806747437s Without get: 0.0041549205780029s
Output for 5.5.15
With get: 0.023910999298096s Without get: 0.0054290294647217s
Output for 5.5.14
With get: 0.026838064193726s Without get: 0.0053658485412598s
Output for 5.5.13
With get: 0.019070863723755s Without get: 0.0044009685516357s
Output for 5.5.12
With get: 0.018739938735962s Without get: 0.0042641162872314s
Output for 5.5.11
With get: 0.023360967636108s Without get: 0.0051999092102051s
Output for 5.5.10
With get: 0.02905797958374s Without get: 0.0062220096588135s
Output for 5.5.9
With get: 0.027809143066406s Without get: 0.0060951709747314s
Output for 5.5.8
With get: 0.027013063430786s Without get: 0.0061688423156738s
Output for 5.5.7
With get: 0.02714991569519s Without get: 0.0060720443725586s
Output for 5.5.6
With get: 0.026732921600342s Without get: 0.0059149265289307s
Output for 5.5.5
With get: 0.026717185974121s Without get: 0.0058708190917969s
Output for 5.5.4
With get: 0.027465105056763s Without get: 0.0059490203857422s
Output for 5.5.3
With get: 0.027073860168457s Without get: 0.0059168338775635s
Output for 5.5.2
With get: 0.028214931488037s Without get: 0.0061399936676025s
Output for 5.5.1
With get: 0.018900871276855s Without get: 0.0042970180511475s
Output for 5.5.0
With get: 0.02816104888916s Without get: 0.0059897899627686s
Output for 5.4.45
With get: 0.025006055831909s Without get: 0.0053789615631104s
Output for 5.4.44
With get: 0.023645162582397s Without get: 0.0055480003356934s
Output for 5.4.43
With get: 0.024622201919556s Without get: 0.0053999423980713s
Output for 5.4.42
With get: 0.023079872131348s Without get: 0.0047910213470459s
Output for 5.4.41
With get: 0.022037982940674s Without get: 0.0048210620880127s
Output for 5.4.40
With get: 0.028014183044434s Without get: 0.0058689117431641s
Output for 5.4.39
With get: 0.026330947875977s Without get: 0.005748987197876s
Output for 5.4.38
With get: 0.025527000427246s Without get: 0.0056388378143311s
Output for 5.4.37
With get: 0.026039123535156s Without get: 0.0058140754699707s
Output for 5.4.36
With get: 0.023365020751953s Without get: 0.0052080154418945s
Output for 5.4.35
With get: 0.026280879974365s Without get: 0.0056161880493164s
Output for 5.4.34
With get: 0.021577119827271s Without get: 0.004892110824585s
Output for 5.4.32
With get: 0.01807689666748s Without get: 0.0042188167572021s
Output for 5.4.31
With get: 0.02668309211731s Without get: 0.0058920383453369s
Output for 5.4.30
With get: 0.018444061279297s Without get: 0.0040948390960693s
Output for 5.4.29
With get: 0.02350902557373s Without get: 0.0043148994445801s
Output for 5.4.28
With get: 0.024913787841797s Without get: 0.005385160446167s
Output for 5.4.27
With get: 0.026684045791626s Without get: 0.0057568550109863s
Output for 5.4.26
With get: 0.026715040206909s Without get: 0.0058510303497314s
Output for 5.4.25
With get: 0.025629997253418s Without get: 0.0048038959503174s
Output for 5.4.24
With get: 0.027244091033936s Without get: 0.0058128833770752s
Output for 5.4.23
With get: 0.020292043685913s Without get: 0.0048589706420898s
Output for 5.4.22
With get: 0.023376941680908s Without get: 0.005422830581665s
Output for 5.4.21
With get: 0.027095079421997s Without get: 0.005889892578125s
Output for 5.4.20
With get: 0.027551174163818s Without get: 0.0058748722076416s
Output for 5.4.19
With get: 0.022449016571045s Without get: 0.0050508975982666s
Output for 5.4.18
With get: 0.026051044464111s Without get: 0.0056629180908203s
Output for 5.4.17
With get: 0.026921987533569s Without get: 0.0057311058044434s
Output for 5.4.16
With get: 0.020754098892212s Without get: 0.0040919780731201s
Output for 5.4.15
With get: 0.020334005355835s Without get: 0.0046529769897461s
Output for 5.4.14
With get: 0.018102169036865s Without get: 0.0040349960327148s
Output for 5.4.13
With get: 0.024667978286743s Without get: 0.0052089691162109s
Output for 5.4.12
With get: 0.03198504447937s Without get: 0.0056381225585938s
Output for 5.4.11
With get: 0.018144845962524s Without get: 0.0041220188140869s
Output for 5.4.10
With get: 0.018036127090454s Without get: 0.0041129589080811s
Output for 5.4.9
With get: 0.0281081199646s Without get: 0.0061860084533691s
Output for 5.4.8
With get: 0.029685020446777s Without get: 0.0063498020172119s
Output for 5.4.7
With get: 0.026829957962036s Without get: 0.0062100887298584s
Output for 5.4.6
With get: 0.027290105819702s Without get: 0.0060629844665527s
Output for 5.4.5
With get: 0.025115013122559s Without get: 0.0055198669433594s
Output for 5.4.4
With get: 0.026727914810181s Without get: 0.0057501792907715s
Output for 5.4.3
With get: 0.027698040008545s Without get: 0.0051710605621338s
Output for 5.4.2
With get: 0.028650999069214s Without get: 0.0058829784393311s
Output for 5.4.1
With get: 0.017681121826172s Without get: 0.0041799545288086s
Output for 5.4.0
With get: 0.018456220626831s Without get: 0.0042710304260254s
Output for 5.3.29
With get: 0.028066873550415s Without get: 0.0068669319152832s
Output for 5.3.28
With get: 0.03856897354126s Without get: 0.0084991455078125s
Output for 5.3.27
With get: 0.028495073318481s Without get: 0.0067238807678223s
Output for 5.3.26
With get: 0.033658027648926s Without get: 0.0077722072601318s
Output for 5.3.25
With get: 0.033282995223999s Without get: 0.0081799030303955s
Output for 5.3.24
With get: 0.045619964599609s Without get: 0.012584924697876s
Output for 5.3.23
With get: 0.041215896606445s Without get: 0.0088479518890381s
Output for 5.3.22
With get: 0.04236102104187s Without get: 0.0090649127960205s
Output for 5.3.21
With get: 0.038012027740479s Without get: 0.0082130432128906s
Output for 5.3.20
With get: 0.028066873550415s Without get: 0.0070161819458008s
Output for 5.3.19
With get: 0.043128967285156s Without get: 0.0095958709716797s
Output for 5.3.18
With get: 0.030045032501221s Without get: 0.0072131156921387s
Output for 5.3.17
With get: 0.028355836868286s Without get: 0.006782054901123s
Output for 5.3.16
With get: 0.042662858963013s Without get: 0.0093331336975098s
Output for 5.3.15
With get: 0.035654067993164s Without get: 0.008659839630127s
Output for 5.3.14
With get: 0.042143106460571s Without get: 0.0091559886932373s
Output for 5.3.13
With get: 0.042115926742554s Without get: 0.0091488361358643s
Output for 5.3.12
With get: 0.031403779983521s Without get: 0.0071330070495605s
Output for 5.3.11
With get: 0.029522180557251s Without get: 0.0070161819458008s
Output for 5.3.10
With get: 0.027955055236816s Without get: 0.0067219734191895s
Output for 5.3.9
With get: 0.03201699256897s Without get: 0.0068809986114502s
Output for 5.3.8
With get: 0.041873931884766s Without get: 0.009213924407959s
Output for 5.3.7
With get: 0.027884006500244s Without get: 0.0069160461425781s
Output for 5.3.6
With get: 0.02785587310791s Without get: 0.0067329406738281s
Output for 5.3.5
With get: 0.040949106216431s Without get: 0.0088860988616943s
Output for 5.3.4
With get: 0.027868986129761s Without get: 0.0069968700408936s
Output for 5.3.3
With get: 0.044333934783936s Without get: 0.010550022125244s
Output for 5.3.2
With get: 0.042734146118164s Without get: 0.0092020034790039s
Output for 5.3.1
With get: 0.028295993804932s Without get: 0.0069420337677002s
Output for 5.3.0
With get: 0.028784990310669s Without get: 0.0073580741882324s
Output for 5.2.17
With get: 0.050961971282959s Without get: 0.011630058288574s
Output for 5.2.16
With get: 0.03413987159729s Without get: 0.0089762210845947s
Output for 5.2.15
With get: 0.053559064865112s Without get: 0.012192010879517s
Output for 5.2.14
With get: 0.052274942398071s Without get: 0.011981964111328s
Output for 5.2.13
With get: 0.042685985565186s Without get: 0.010172843933105s
Output for 5.2.12
With get: 0.034379005432129s Without get: 0.0085539817810059s
Output for 5.2.11
With get: 0.038158178329468s Without get: 0.0087409019470215s
Output for 5.2.10
With get: 0.033622026443481s Without get: 0.0085768699645996s
Output for 5.2.9
With get: 0.035377025604248s Without get: 0.0085999965667725s
Output for 5.2.8
With get: 0.032989978790283s Without get: 0.0086030960083008s
Output for 5.2.7
With get: 0.041043996810913s Without get: 0.010470151901245s
Output for 5.2.6
With get: 0.034682989120483s Without get: 0.0086140632629395s
Output for 5.2.5
With get: 0.042582988739014s Without get: 0.010390996932983s
Output for 5.2.4
With get: 0.036972999572754s Without get: 0.010174036026001s
Output for 5.2.3
With get: 0.032737016677856s Without get: 0.0085411071777344s
Output for 5.2.2
With get: 0.051784038543701s Without get: 0.011713027954102s
Output for 5.2.1
With get: 0.040050983428955s Without get: 0.011687994003296s
Output for 5.2.0
With get: 0.031847953796387s Without get: 0.0084738731384277s
Output for 5.1.6
With get: 0.032227039337158s Without get: 0.0087790489196777s
Output for 5.1.5
With get: 0.032007932662964s Without get: 0.0091700553894043s
Output for 5.1.4
With get: 0.031606197357178s Without get: 0.0086121559143066s
Output for 5.1.3
With get: 0.031211137771606s Without get: 0.0083098411560059s
Output for 5.1.2
With get: 0.031380176544189s Without get: 0.008587121963501s
Output for 5.1.1
With get: 0.033167123794556s Without get: 0.0088071823120117s
Output for 5.1.0
With get: 0.031797170639038s Without get: 0.0086159706115723s
Output for 5.0.0 - 5.0.5
<br /> <b>Fatal error</b>: Cannot access private property A::$_field in <b>/in/Ldrg3</b> on line <b>17</b><br />
Process exited with code 255.
Output for 4.4.2 - 4.4.9
<br /> <b>Parse error</b>: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in <b>/in/Ldrg3</b> on line <b>5</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
<br /> <b>Parse error</b>: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in <b>/in/Ldrg3</b> on line <b>5</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.3.4
<br /> <b>Parse error</b>: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in <b>/in/Ldrg3</b> on line <b>5</b><br />
Process exited with code 255.