3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function test($label = '') { global $t; $t2 = microtime(1); if ($label) echo str_pad($label . ': ', 32, '.', STR_PAD_RIGHT) . ' ' . 1000 * ($t2 - $t) . 'ms' . "\n"; $t = $t2; } class Foo2 { public function fooLoop() { for ($i = 1000000; $i--;) $this->foo(); } public function barLoop() { for ($i = 1000000; $i--;) $this->bar(); } public function bazLoop() { for ($i = 1000000; $i--;) $this->baz(); } public function foo() { } protected function bar() { } private function baz() { } } $f = new Foo2(); test(); $f->fooLoop(); test('pub'); $f->barLoop(); test('pro'); $f->bazLoop(); test('pri');
Output for 7.3.1
pub: ........................... 21.456003189087ms pro: ........................... 19.721984863281ms pri: ........................... 20.001888275146ms
Output for 7.3.0
pub: ........................... 25.336027145386ms pro: ........................... 21.054983139038ms pri: ........................... 19.195079803467ms
Output for 7.2.13
pub: ........................... 24.037837982178ms pro: ........................... 22.886991500854ms pri: ........................... 25.081157684326ms
Output for 7.2.12
pub: ........................... 35.156011581421ms pro: ........................... 23.847103118896ms pri: ........................... 28.717994689941ms
Output for 7.2.11
pub: ........................... 25.439023971558ms pro: ........................... 27.032136917114ms pri: ........................... 26.417016983032ms
Output for 7.2.10
pub: ........................... 25.46501159668ms pro: ........................... 23.056030273438ms pri: ........................... 25.215864181519ms
Output for 7.2.9
pub: ........................... 24.566888809204ms pro: ........................... 22.668123245239ms pri: ........................... 23.540019989014ms
Output for 7.2.8
pub: ........................... 23.744821548462ms pro: ........................... 22.685050964355ms pri: ........................... 23.534059524536ms
Output for 7.2.7
pub: ........................... 23.273944854736ms pro: ........................... 22.829055786133ms pri: ........................... 23.538827896118ms
Output for 7.2.6
pub: ........................... 25.299072265625ms pro: ........................... 25.439977645874ms pri: ........................... 26.319026947021ms
Output for 7.2.5
pub: ........................... 22.93586730957ms pro: ........................... 30.857086181641ms pri: ........................... 37.871837615967ms
Output for 7.2.4
pub: ........................... 38.712978363037ms pro: ........................... 32.135009765625ms pri: ........................... 23.880958557129ms
Output for 7.2.3
pub: ........................... 23.364067077637ms pro: ........................... 22.736072540283ms pri: ........................... 23.61798286438ms
Output for 7.2.2
pub: ........................... 28.475999832153ms pro: ........................... 25.44116973877ms pri: ........................... 25.7248878479ms
Output for 7.2.1
pub: ........................... 30.977010726929ms pro: ........................... 33.244132995605ms pri: ........................... 35.181045532227ms
Output for 7.2.0
pub: ........................... 29.910087585449ms pro: ........................... 25.733947753906ms pri: ........................... 26.87406539917ms
Output for 7.1.25
pub: ........................... 54.88920211792ms pro: ........................... 78.844785690308ms pri: ........................... 60.243129730225ms
Output for 7.1.21
pub: ........................... 34.003973007202ms pro: ........................... 26.320934295654ms pri: ........................... 26.61395072937ms
Output for 7.1.20
pub: ........................... 38.587808609009ms pro: ........................... 33.415079116821ms pri: ........................... 37.170886993408ms
Output for 7.1.19
pub: ........................... 33.643007278442ms pro: ........................... 24.497032165527ms pri: ........................... 28.052091598511ms
Output for 7.1.18
pub: ........................... 41.594982147217ms pro: ........................... 48.229932785034ms pri: ........................... 37.971973419189ms
Output for 7.1.17
pub: ........................... 31.953811645508ms pro: ........................... 25.804996490479ms pri: ........................... 25.262117385864ms
Output for 7.1.16
pub: ........................... 41.317939758301ms pro: ........................... 33.442974090576ms pri: ........................... 34.649133682251ms
Output for 7.1.15
pub: ........................... 25.485992431641ms pro: ........................... 25.246143341064ms pri: ........................... 24.982929229736ms
Output for 7.1.14
pub: ........................... 49.519062042236ms pro: ........................... 44.893026351929ms pri: ........................... 44.812917709351ms
Output for 7.1.13
pub: ........................... 26.108980178833ms pro: ........................... 24.731874465942ms pri: ........................... 25.01106262207ms
Output for 7.1.12
pub: ........................... 32.13095664978ms pro: ........................... 33.118963241577ms pri: ........................... 25.582075119019ms
Output for 7.1.11
pub: ........................... 38.215160369873ms pro: ........................... 26.371955871582ms pri: ........................... 31.394004821777ms
Output for 7.1.10
pub: ........................... 27.266979217529ms pro: ........................... 25.196075439453ms pri: ........................... 24.677038192749ms
Output for 7.1.9
pub: ........................... 48.639059066772ms pro: ........................... 46.133041381836ms pri: ........................... 56.397914886475ms
Output for 7.1.8
pub: ........................... 45.108795166016ms pro: ........................... 26.576995849609ms pri: ........................... 50.548076629639ms
Output for 7.1.7
pub: ........................... 35.221099853516ms pro: ........................... 27.719020843506ms pri: ........................... 26.445865631104ms
Output for 7.1.6
pub: ........................... 24.238109588623ms pro: ........................... 40.920972824097ms pri: ........................... 31.022071838379ms
Output for 7.1.5
pub: ........................... 30.904054641724ms pro: ........................... 25.43306350708ms pri: ........................... 24.674892425537ms
Output for 7.1.4
pub: ........................... 26.556968688965ms pro: ........................... 37.276029586792ms pri: ........................... 43.601989746094ms
Output for 7.1.3
pub: ........................... 35.094022750854ms pro: ........................... 26.847124099731ms pri: ........................... 26.144981384277ms
Output for 7.1.2
pub: ........................... 25.842905044556ms pro: ........................... 25.306940078735ms pri: ........................... 24.893999099731ms
Output for 7.1.1
pub: ........................... 72.042942047119ms pro: ........................... 78.174114227295ms pri: ........................... 58.816909790039ms
Output for 7.1.0
pub: ........................... 56.29301071167ms pro: ........................... 53.016901016235ms pri: ........................... 47.873020172119ms
Output for 7.0.31
pub: ........................... 39.437055587769ms pro: ........................... 26.359081268311ms pri: ........................... 25.238990783691ms
Output for 7.0.30
pub: ........................... 32.803058624268ms pro: ........................... 26.32212638855ms pri: ........................... 28.188943862915ms
Output for 7.0.29
pub: ........................... 35.711050033569ms pro: ........................... 26.587009429932ms pri: ........................... 34.92283821106ms
Output for 7.0.28
pub: ........................... 80.67512512207ms pro: ........................... 48.136949539185ms pri: ........................... 48.120975494385ms
Output for 7.0.27
pub: ........................... 43.473958969116ms pro: ........................... 28.295040130615ms pri: ........................... 24.857044219971ms
Output for 7.0.26
pub: ........................... 30.388832092285ms pro: ........................... 26.777029037476ms pri: ........................... 26.478052139282ms
Output for 7.0.25
pub: ........................... 26.777029037476ms pro: ........................... 25.307893753052ms pri: ........................... 24.901151657104ms
Output for 7.0.24
pub: ........................... 28.842926025391ms pro: ........................... 27.864933013916ms pri: ........................... 27.395963668823ms
Output for 7.0.23
pub: ........................... 49.065828323364ms pro: ........................... 27.842044830322ms pri: ........................... 25.025129318237ms
Output for 7.0.22
pub: ........................... 48.336982727051ms pro: ........................... 44.59810256958ms pri: ........................... 38.944959640503ms
Output for 7.0.21
pub: ........................... 47.938108444214ms pro: ........................... 46.643018722534ms pri: ........................... 41.002035140991ms
Output for 7.0.20
pub: ........................... 54.883003234863ms pro: ........................... 27.997016906738ms pri: ........................... 25.71702003479ms
Output for 7.0.19
pub: ........................... 35.424947738647ms pro: ........................... 30.236005783081ms pri: ........................... 37.559032440186ms
Output for 7.0.18
pub: ........................... 30.757188796997ms pro: ........................... 24.901866912842ms pri: ........................... 25.157928466797ms
Output for 7.0.17
pub: ........................... 28.074026107788ms pro: ........................... 26.005983352661ms pri: ........................... 26.615858078003ms
Output for 7.0.16
pub: ........................... 78.585863113403ms pro: ........................... 39.633989334106ms pri: ........................... 26.262998580933ms
Output for 7.0.15
pub: ........................... 61.409950256348ms pro: ........................... 48.792123794556ms pri: ........................... 40.640830993652ms
Output for 7.0.14
pub: ........................... 91.905117034912ms pro: ........................... 80.528020858765ms pri: ........................... 43.674945831299ms
Output for 7.0.13
pub: ........................... 37.919044494629ms pro: ........................... 26.597023010254ms pri: ........................... 26.534080505371ms
Output for 7.0.12
pub: ........................... 52.868127822876ms pro: ........................... 51.148891448975ms pri: ........................... 51.182985305786ms
Output for 7.0.11
pub: ........................... 92.036008834839ms pro: ........................... 47.228813171387ms pri: ........................... 28.279066085815ms
Output for 7.0.10
pub: ........................... 67.003011703491ms pro: ........................... 63.138008117676ms pri: ........................... 61.936855316162ms
Output for 7.0.9
pub: ........................... 60.737133026123ms pro: ........................... 50.280809402466ms pri: ........................... 72.357177734375ms
Output for 7.0.8
pub: ........................... 53.645133972168ms pro: ........................... 32.176971435547ms pri: ........................... 50.838947296143ms
Output for 7.0.7
pub: ........................... 49.968957901001ms pro: ........................... 31.588077545166ms pri: ........................... 26.012897491455ms
Output for 7.0.6
pub: ........................... 57.543992996216ms pro: ........................... 30.774831771851ms pri: ........................... 28.663158416748ms
Output for 7.0.5
pub: ........................... 81.805944442749ms pro: ........................... 30.809879302979ms pri: ........................... 35.561084747314ms
Output for 7.0.4
pub: ........................... 83.56499671936ms pro: ........................... 45.435905456543ms pri: ........................... 29.568195343018ms
Output for 7.0.3
pub: ........................... 58.557987213135ms pro: ........................... 48.797130584717ms pri: ........................... 54.960966110229ms
Output for 7.0.2
pub: ........................... 69.63586807251ms pro: ........................... 82.916975021362ms pri: ........................... 77.757120132446ms
Output for 7.0.1
pub: ........................... 35.162925720215ms pro: ........................... 41.851997375488ms pri: ........................... 46.446084976196ms
Output for 7.0.0
pub: ........................... 49.488067626953ms pro: ........................... 53.614854812622ms pri: ........................... 48.20704460144ms
Output for hhvm-3.22.0
pub: ........................... 106.34541511536ms pro: ........................... 89.460611343384ms pri: ........................... 99.346160888672ms
Output for hhvm-3.21.3
pub: ........................... 94.204425811768ms pro: ........................... 96.708297729492ms pri: ........................... 108.65163803101ms
Output for hhvm-3.21.0
pub: ........................... 154.61301803589ms pro: ........................... 90.182065963745ms pri: ........................... 145.68185806274ms
Output for hhvm-3.20.2
pub: ........................... 164.73627090454ms pro: ........................... 117.56157875061ms pri: ........................... 92.777013778687ms
Output for hhvm-3.19.2
pub: ........................... 95.981359481812ms pro: ........................... 91.260433197021ms pri: ........................... 95.185518264771ms
Output for hhvm-3.18.5
pub: ........................... 108.37316513062ms pro: ........................... 102.942943573ms pri: ........................... 102.84686088562ms
Output for hhvm-3.18.4
pub: ........................... 139.93811607361ms pro: ........................... 104.40278053284ms pri: ........................... 103.90019416809ms
Output for hhvm-3.15.4
pub: ........................... 145.77722549438ms pro: ........................... 106.76980018616ms pri: ........................... 115.55004119873ms
Output for 5.6.30
pub: ........................... 124.53293800354ms pro: ........................... 117.77114868164ms pri: ........................... 117.0449256897ms