3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { private $bar; public function setBar($bar) { $this->bar = $bar; } public function getBar() { return $this->bar; } } $n = 10000; $t = microtime(true); $foo = new Foo(); for ($i = 0; $i < $n; $i++) { $foo->setBar("foo"); $foo->getBar(); } echo number_format(microtime(true) - $t, 6) . "\n"; $t = microtime(true); $reflClass = new ReflectionClass('Foo'); $property = $reflClass->getProperty('bar'); $property->setAccessible(true); $foo = new Foo(); for ($i = 0; $i < $n; $i++) { $property->setValue($foo, "bar"); $property->getValue($foo); } echo number_format(microtime(true) - $t, 6) . "\n";
Output for 7.1.0
0.000546 0.002240
Output for 7.0.14
0.001269 0.004137
Output for 7.0.8
0.000694 0.002148
Output for 7.0.7
0.000803 0.002546
Output for 7.0.6
0.000946 0.002797
Output for 7.0.5
0.000891 0.002815
Output for 7.0.4
0.000884 0.003120
Output for 7.0.3
0.000973 0.003580
Output for 7.0.2
0.000955 0.002987
Output for 7.0.1
0.000947 0.003009
Output for 7.0.0
0.000837 0.002698
Output for hhvm-3.12.0
0.003413 0.022375
Output for hhvm-3.10.0
0.004108 0.040617
Output for 5.6.28
0.003501 0.007637
Output for 5.6.23
0.003489 0.007280
Output for 5.6.22
0.002612 0.004317
Output for 5.6.21
0.002733 0.005957
Output for 5.6.20
0.003399 0.006816
Output for 5.6.19
0.002465 0.004774
Output for 5.6.18
0.002830 0.005559
Output for 5.6.17
0.002782 0.005151
Output for 5.6.16
0.003160 0.006220
Output for 5.6.15
0.002849 0.006090
Output for 5.6.14
0.003015 0.006039
Output for 5.6.13
0.002151 0.004278
Output for 5.6.12
0.002782 0.005616
Output for 5.6.11
0.003073 0.006347
Output for 5.6.10
0.003062 0.006681
Output for 5.6.9
0.002966 0.006423
Output for 5.6.8
0.002907 0.006083
Output for 5.6.7
0.003147 0.006286
Output for 5.6.6
0.003266 0.005697
Output for 5.6.5
0.002637 0.005516
Output for 5.6.4
0.002517 0.006501
Output for 5.6.3
0.001784 0.003766
Output for 5.6.2
0.002228 0.004434
Output for 5.6.1
0.001818 0.003820
Output for 5.6.0
0.001799 0.003874
Output for 5.5.37
0.002621 0.005529
Output for 5.5.36
0.002827 0.006416
Output for 5.5.35
0.002901 0.006379
Output for 5.5.34
0.002943 0.006847
Output for 5.5.33
0.003067 0.006737
Output for 5.5.32
0.003655 0.005757
Output for 5.5.31
0.003057 0.006510
Output for 5.5.30
0.002521 0.005441
Output for 5.5.29
0.002762 0.006120
Output for 5.5.28
0.002633 0.005823
Output for 5.5.27
0.002865 0.005758
Output for 5.5.26
0.002631 0.005853
Output for 5.5.25
0.002962 0.006308
Output for 5.5.24
0.002349 0.005327
Output for 5.5.23
0.002885 0.006226
Output for 5.5.22
0.002771 0.006165
Output for 5.5.21
0.002895 0.006357
Output for 5.5.20
0.003573 0.007540
Output for 5.5.19
0.002291 0.004586
Output for 5.5.18
0.002501 0.005355
Output for 5.5.16
0.001788 0.004111
Output for 5.5.15
0.001759 0.003931
Output for 5.5.14
0.002166 0.004857
Output for 5.5.13
0.002304 0.004390
Output for 5.5.12
0.001914 0.004326
Output for 5.5.11
0.001745 0.004004
Output for 5.5.10
0.002318 0.004544
Output for 5.5.9
0.001760 0.003850
Output for 5.5.8
0.001751 0.003933
Output for 5.5.7
0.002280 0.004920
Output for 5.5.6
0.001703 0.004025
Output for 5.5.5
0.001922 0.004165
Output for 5.5.4
0.001735 0.004044
Output for 5.5.3
0.002828 0.005801
Output for 5.5.2
0.002248 0.005456
Output for 5.5.1
0.001782 0.003839
Output for 5.5.0
0.001830 0.003957
Output for 5.4.45
0.002621 0.005601
Output for 5.4.44
0.003045 0.006647
Output for 5.4.43
0.002854 0.006469
Output for 5.4.42
0.003052 0.006070
Output for 5.4.41
0.002872 0.006237
Output for 5.4.40
0.002798 0.005855
Output for 5.4.39
0.002819 0.006261
Output for 5.4.38
0.002630 0.005547
Output for 5.4.37
0.002799 0.006147
Output for 5.4.36
0.002768 0.005053
Output for 5.4.35
0.002519 0.005629
Output for 5.4.34
0.001986 0.004416
Output for 5.4.32
0.001895 0.004080
Output for 5.4.31
0.001977 0.004042
Output for 5.4.30
0.001760 0.003754
Output for 5.4.29
0.003902 0.008255
Output for 5.4.28
0.001976 0.004129
Output for 5.4.27
0.001833 0.004355
Output for 5.4.26
0.002284 0.004851
Output for 5.4.25
0.001780 0.003777
Output for 5.4.24
0.002305 0.004896
Output for 5.4.23
0.001770 0.003725
Output for 5.4.22
0.002439 0.004938
Output for 5.4.21
0.002326 0.004964
Output for 5.4.20
0.002506 0.004671
Output for 5.4.19
0.001719 0.003679
Output for 5.4.18
0.002084 0.005361
Output for 5.4.17
0.002033 0.003716
Output for 5.4.16
0.002905 0.005998
Output for 5.4.15
0.001989 0.004190
Output for 5.4.14
0.001848 0.003897
Output for 5.4.13
0.002424 0.004309
Output for 5.4.12
0.001941 0.004103
Output for 5.4.11
0.001978 0.004245
Output for 5.4.10
0.001675 0.003665
Output for 5.4.9
0.001759 0.003829
Output for 5.4.8
0.001452 0.003167
Output for 5.4.7
0.001710 0.003742
Output for 5.4.6
0.002745 0.006127
Output for 5.4.5
0.003371 0.006420
Output for 5.4.4
0.002951 0.006425
Output for 5.4.3
0.003004 0.006049
Output for 5.4.2
0.001735 0.003647
Output for 5.4.1
0.002592 0.005908
Output for 5.4.0
0.003016 0.006925
Output for 5.3.29
0.006024 0.006649
Output for 5.3.28
0.006248 0.006687
Output for 5.3.27
0.004404 0.005042
Output for 5.3.26
0.004606 0.005048
Output for 5.3.25
0.004675 0.005197
Output for 5.3.24
0.006999 0.007694
Output for 5.3.23
0.004803 0.005414
Output for 5.3.22
0.005403 0.006640
Output for 5.3.21
0.004011 0.004337
Output for 5.3.20
0.004349 0.004960
Output for 5.3.19
0.005360 0.006159
Output for 5.3.18
0.004188 0.004765
Output for 5.3.17
0.004357 0.004840
Output for 5.3.16
0.006625 0.007679
Output for 5.3.15
0.004338 0.004913
Output for 5.3.14
0.006338 0.008287
Output for 5.3.13
0.007043 0.007842
Output for 5.3.12
0.004976 0.005595
Output for 5.3.11
0.007026 0.008094
Output for 5.3.10
0.007657 0.008342
Output for 5.3.9
0.007621 0.008368
Output for 5.3.8
0.005044 0.005889
Output for 5.3.7
0.006856 0.007475
Output for 5.3.6
0.007217 0.007973
Output for 5.3.5
0.005085 0.006652
Output for 5.3.4
0.007669 0.008385
Output for 5.3.3
0.006295 0.006201
Output for 5.3.2
0.006715 0.007739
Output for 5.3.1
0.006213 0.006224
Output for 5.3.0
0.006645 0.006773
Output for 5.2.17
0.010918 Fatal error: Call to undefined method ReflectionProperty::setAccessible() in /in/n3g0Z on line 31
Process exited with code 255.
Output for 5.2.16
0.010138 Fatal error: Call to undefined method ReflectionProperty::setAccessible() in /in/n3g0Z on line 31
Process exited with code 255.
Output for 5.2.15
0.010496 Fatal error: Call to undefined method ReflectionProperty::setAccessible() in /in/n3g0Z on line 31
Process exited with code 255.
Output for 5.2.14
0.007612 Fatal error: Call to undefined method ReflectionProperty::setAccessible() in /in/n3g0Z on line 31
Process exited with code 255.
Output for 5.2.13
0.011417 Fatal error: Call to undefined method ReflectionProperty::setAccessible() in /in/n3g0Z on line 31
Process exited with code 255.
Output for 5.2.12
0.010803 Fatal error: Call to undefined method ReflectionProperty::setAccessible() in /in/n3g0Z on line 31
Process exited with code 255.
Output for 5.2.11
0.007564 Fatal error: Call to undefined method ReflectionProperty::setAccessible() in /in/n3g0Z on line 31
Process exited with code 255.
Output for 5.2.10
0.011364 Fatal error: Call to undefined method ReflectionProperty::setAccessible() in /in/n3g0Z on line 31
Process exited with code 255.
Output for 5.2.9
0.011139 Fatal error: Call to undefined method ReflectionProperty::setAccessible() in /in/n3g0Z on line 31
Process exited with code 255.
Output for 5.2.8
0.007533 Fatal error: Call to undefined method ReflectionProperty::setAccessible() in /in/n3g0Z on line 31
Process exited with code 255.
Output for 5.2.7
0.010154 Fatal error: Call to undefined method ReflectionProperty::setAccessible() in /in/n3g0Z on line 31
Process exited with code 255.
Output for 5.2.6
0.010983 Fatal error: Call to undefined method ReflectionProperty::setAccessible() in /in/n3g0Z on line 31
Process exited with code 255.
Output for 5.2.5
0.008708 Fatal error: Call to undefined method ReflectionProperty::setAccessible() in /in/n3g0Z on line 31
Process exited with code 255.
Output for 5.2.4
0.011373 Fatal error: Call to undefined method ReflectionProperty::setAccessible() in /in/n3g0Z on line 31
Process exited with code 255.
Output for 5.2.3
0.011031 Fatal error: Call to undefined method ReflectionProperty::setAccessible() in /in/n3g0Z on line 31
Process exited with code 255.
Output for 5.2.2
0.009586 Fatal error: Call to undefined method ReflectionProperty::setAccessible() in /in/n3g0Z on line 31
Process exited with code 255.
Output for 5.2.1
0.011099 Fatal error: Call to undefined method ReflectionProperty::setAccessible() in /in/n3g0Z on line 31
Process exited with code 255.
Output for 5.2.0
0.012334 Fatal error: Call to undefined method ReflectionProperty::setAccessible() in /in/n3g0Z on line 31
Process exited with code 255.
Output for 5.1.6
0.013398 Fatal error: Call to undefined method ReflectionProperty::setAccessible() in /in/n3g0Z on line 31
Process exited with code 255.
Output for 5.1.5
0.010230 Fatal error: Call to undefined method ReflectionProperty::setAccessible() in /in/n3g0Z on line 31
Process exited with code 255.
Output for 5.1.4
0.011147 Fatal error: Call to undefined method ReflectionProperty::setAccessible() in /in/n3g0Z on line 31
Process exited with code 255.
Output for 5.1.3
0.011824 Fatal error: Call to undefined method ReflectionProperty::setAccessible() in /in/n3g0Z on line 31
Process exited with code 255.
Output for 5.1.2
0.010213 Fatal error: Call to undefined method ReflectionProperty::setAccessible() in /in/n3g0Z on line 31
Process exited with code 255.
Output for 5.1.1
0.008351 Fatal error: Call to undefined method ReflectionProperty::setAccessible() in /in/n3g0Z on line 31
Process exited with code 255.
Output for 5.1.0
0.007756 Fatal error: Call to undefined method ReflectionProperty::setAccessible() in /in/n3g0Z on line 31
Process exited with code 255.
Output for 5.0.5
0.007962 Fatal error: Call to undefined method ReflectionProperty::setAccessible() in /in/n3g0Z on line 31
Process exited with code 255.
Output for 5.0.4
0.012261 Fatal error: Call to undefined method ReflectionProperty::setAccessible() in /in/n3g0Z on line 31
Process exited with code 255.
Output for 5.0.3
0.011957 Fatal error: Call to undefined method ReflectionProperty::setAccessible() in /in/n3g0Z on line 31
Process exited with code 255.
Output for 5.0.2
0.015628 Fatal error: Call to undefined method ReflectionProperty::setAccessible() in /in/n3g0Z on line 31
Process exited with code 255.
Output for 5.0.1
0.011678 Fatal error: Call to undefined method ReflectionProperty::setAccessible() in /in/n3g0Z on line 31
Process exited with code 255.
Output for 5.0.0
0.013352 Fatal error: Call to undefined method ReflectionProperty::setAccessible() in /in/n3g0Z on line 31
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/n3g0Z on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/n3g0Z on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/n3g0Z on line 5
Process exited with code 255.