3v4l.org

run code in 300+ PHP versions simultaneously
<?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.4.1
0.000998 0.002181
Output for 7.4.0
0.001322 0.003215
Output for 7.3.13
0.001459 0.003317
Output for 7.3.12
0.001420 0.003427
Output for 7.3.11
0.001380 0.003261
Output for 7.3.10
0.001123 0.002080
Output for 7.3.9
0.001186 0.002051
Output for 7.3.8
0.000958 0.002044
Output for 7.3.7
0.002299 0.003589
Output for 7.3.6
0.001220 0.002972
Output for 7.3.5
0.000924 0.002081
Output for 7.3.4
0.001763 0.001865
Output for 7.3.3
0.000893 0.002174
Output for 7.3.2
0.001008 0.002137
Output for 7.3.1
0.001476 0.003449
Output for 7.3.0
0.001145 0.002204
Output for 7.2.26
0.001329 0.004522
Output for 7.2.25
0.001426 0.004678
Output for 7.2.24
0.000862 0.003520
Output for 7.2.23
0.000810 0.003329
Output for 7.2.22
0.001031 0.003413
Output for 7.2.21
0.000865 0.003367
Output for 7.2.20
0.001009 0.003819
Output for 7.2.19
0.000869 0.003348
Output for 7.2.18
0.001226 0.003676
Output for 7.2.17
0.001024 0.003598
Output for 7.2.16
0.001300 0.003808
Output for 7.2.15
0.000895 0.003404
Output for 7.2.14
0.001015 0.003636
Output for 7.2.13
0.001463 0.003618
Output for 7.2.12
0.001207 0.004636
Output for 7.2.11
0.000839 0.003338
Output for 7.2.10
0.000867 0.003251
Output for 7.2.9
0.001088 0.003333
Output for 7.2.8
0.001415 0.004510
Output for 7.2.7
0.000863 0.003354
Output for 7.2.6
0.001268 0.004973
Output for 7.2.5
0.000949 0.003581
Output for 7.2.4
0.000864 0.003342
Output for 7.2.3
0.001238 0.004665
Output for 7.2.2
0.000857 0.003282
Output for 7.2.1
0.000847 0.003262
Output for 7.2.0
0.001190 0.003630
Output for 7.1.33
0.002541 0.005775
Output for 7.1.32
0.002351 0.005239
Output for 7.1.31
0.001689 0.003784
Output for 7.1.30
0.001700 0.003742
Output for 7.1.29
0.001698 0.003828
Output for 7.1.28
0.001704 0.003772
Output for 7.1.27
0.001656 0.003741
Output for 7.1.26
0.003368 0.003790
Output for 7.1.25
0.001747 0.003650
Output for 7.1.24
0.001805 0.003742
Output for 7.1.23
0.002970 0.004990
Output for 7.1.22
0.002614 0.005929
Output for 7.1.21
0.002101 0.005753
Output for 7.1.20
0.001691 0.003751
Output for 7.1.19
0.001671 0.003653
Output for 7.1.18
0.001901 0.003783
Output for 7.1.17
0.001968 0.004330
Output for 7.1.16
0.001745 0.003739
Output for 7.1.15
0.002076 0.003758
Output for 7.1.14
0.001679 0.003775
Output for 7.1.13
0.002476 0.004761
Output for 7.1.12
0.001607 0.003819
Output for 7.1.11
0.001980 0.004598
Output for 7.1.10
0.002689 0.003756
Output for 7.1.9
0.001603 0.003674
Output for 7.1.8
0.002099 0.004869
Output for 7.1.7
0.001669 0.003734
Output for 7.1.6
0.001663 0.003834
Output for 7.1.5
0.001615 0.003818
Output for 7.1.4
0.001805 0.004458
Output for 7.1.3
0.001683 0.003677
Output for 7.1.2
0.002640 0.005808
Output for 7.1.1
0.001704 0.004179
Output for 7.1.0
0.003345 0.004459
Output for 7.0.33
0.001554 0.003914
Output for 7.0.32
0.002724 0.003746
Output for 7.0.31
0.002328 0.006071
Output for 7.0.30
0.002561 0.005953
Output for 7.0.29
0.002373 0.004989
Output for 7.0.28
0.001652 0.003685
Output for 7.0.27
0.001649 0.003769
Output for 7.0.26
0.002096 0.003691
Output for 7.0.25
0.001902 0.003685
Output for 7.0.24
0.001753 0.004288
Output for 7.0.23
0.001744 0.004282
Output for 7.0.22
0.003368 0.004146
Output for 7.0.21
0.001589 0.003738
Output for 7.0.20
0.001552 0.003757
Output for 7.0.19
0.001655 0.003879
Output for 7.0.18
0.001912 0.004276
Output for 7.0.17
0.002849 0.005564
Output for 7.0.16
0.002361 0.004313
Output for 7.0.15
0.003012 0.005518
Output for 7.0.14
0.002837 0.005365
Output for 7.0.13
0.002110 0.005241
Output for 7.0.12
0.002022 0.004179
Output for 7.0.11
0.002493 0.003839
Output for 7.0.10
0.002029 0.004792
Output for 7.0.9
0.002031 0.005674
Output for 7.0.8
0.002430 0.006581
Output for 7.0.7
0.001671 0.003891
Output for 7.0.6
0.002218 0.003801
Output for 7.0.5
0.002023 0.004609
Output for 7.0.4
0.002504 0.004863
Output for 7.0.3
0.002544 0.005789
Output for 7.0.2
0.002576 0.003828
Output for 7.0.1
0.002338 0.005744
Output for 7.0.0
0.003425 0.003718
Output for 5.6.40
0.003972 0.006384
Output for 5.6.39
0.005704 0.007191
Output for 5.6.38
0.007039 0.010841
Output for 5.6.37
0.005800 0.009287
Output for 5.6.36
0.006625 0.006595
Output for 5.6.35
0.004032 0.006422
Output for 5.6.34
0.004032 0.006450
Output for 5.6.33
0.004993 0.007764
Output for 5.6.32
0.003929 0.006418
Output for 5.6.31
0.003901 0.007209
Output for 5.6.30
0.004524 0.006415
Output for 5.6.29
0.005364 0.010335
Output for 5.6.28
0.005767 0.007060
Output for 5.6.27
0.004032 0.006552
Output for 5.6.26
0.004180 0.007091
Output for 5.6.25
0.004326 0.007189
Output for 5.6.24
0.004856 0.007550
Output for 5.6.23
0.005800 0.008215
Output for 5.6.22
0.004050 0.006454
Output for 5.6.21
0.005495 0.007068
Output for 5.6.20
0.004588 0.007636
Output for 5.6.19
0.003907 0.006576
Output for 5.6.18
0.005154 0.007917
Output for 5.6.17
0.005651 0.006415
Output for 5.6.16
0.004460 0.006480
Output for 5.6.15
0.005464 0.007876
Output for 5.6.14
0.004241 0.006914
Output for 5.6.13
0.004318 0.007447
Output for 5.6.12
0.004203 0.006416
Output for 5.6.11
0.005962 0.007164
Output for 5.6.10
0.006133 0.006716
Output for 5.6.9
0.003924 0.006456
Output for 5.6.8
0.005648 0.007698
Output for 5.6.7
0.006206 0.007756
Output for 5.6.6
0.004530 0.006357
Output for 5.6.5
0.005646 0.007702
Output for 5.6.4
0.005744 0.010692
Output for 5.6.3
0.006022 0.006968
Output for 5.6.2
0.005203 0.008027
Output for 5.6.1
0.006254 0.007849
Output for 5.6.0
0.005605 0.006432
Output for 5.5.38
0.006582 0.007770
Output for 5.5.37
0.007401 0.006583
Output for 5.5.36
0.004677 0.006904
Output for 5.5.35
0.005464 0.007238
Output for 5.5.34
0.004441 0.006560
Output for 5.5.33
0.004081 0.006476
Output for 5.5.32
0.004025 0.006528
Output for 5.5.31
0.004371 0.007225
Output for 5.5.30
0.005547 0.006528
Output for 5.5.29
0.004021 0.006504
Output for 5.5.28
0.004092 0.006522
Output for 5.5.27
0.006694 0.006662
Output for 5.5.26
0.006358 0.006525
Output for 5.5.25
0.007260 0.006399
Output for 5.5.24
0.004022 0.006478
Output for 5.5.23
0.004667 0.006440
Output for 5.5.22
0.007560 0.006482
Output for 5.5.21
0.004001 0.006536
Output for 5.5.20
0.005846 0.010989
Output for 5.5.19
0.005203 0.006444
Output for 5.5.18
0.003916 0.006386
Output for 5.5.17
0.003983 0.006472
Output for 5.5.16
0.006815 0.006486
Output for 5.5.15
0.003879 0.006548
Output for 5.5.14
0.004658 0.007105
Output for 5.5.13
0.003885 0.006470
Output for 5.5.12
0.004301 0.006406
Output for 5.5.11
0.004924 0.006454
Output for 5.5.10
0.006896 0.006458
Output for 5.5.9
0.006675 0.006628
Output for 5.5.8
0.004453 0.006949
Output for 5.5.7
0.004354 0.006380
Output for 5.5.6
0.003890 0.008138
Output for 5.5.5
0.004570 0.006399
Output for 5.5.4
0.004029 0.006489
Output for 5.5.3
0.004423 0.006371
Output for 5.5.2
0.003919 0.006324
Output for 5.5.1
0.006711 0.006414
Output for 5.5.0
0.004692 0.006355
Output for 5.4.45
0.004421 0.006686
Output for 5.4.44
0.005314 0.008263
Output for 5.4.43
0.005329 0.006836
Output for 5.4.42
0.004434 0.006679
Output for 5.4.41
0.005556 0.008809
Output for 5.4.40
0.005403 0.006629
Output for 5.4.39
0.007441 0.007002
Output for 5.4.38
0.004097 0.006695
Output for 5.4.37
0.008549 0.007030
Output for 5.4.36
0.008105 0.007507
Output for 5.4.35
0.005779 0.006784
Output for 5.4.34
0.004163 0.006741
Output for 5.4.33
0.005028 0.007028
Output for 5.4.32
0.004331 0.006637
Output for 5.4.31
0.004042 0.007960
Output for 5.4.30
0.004184 0.006958
Output for 5.4.29
0.005863 0.006734
Output for 5.4.28
0.005908 0.011231
Output for 5.4.27
0.005880 0.010992
Output for 5.4.26
0.005640 0.006653
Output for 5.4.25
0.008256 0.006856
Output for 5.4.24
0.004478 0.007202
Output for 5.4.23
0.004597 0.006732
Output for 5.4.22
0.004811 0.007620
Output for 5.4.21
0.009229 0.006913
Output for 5.4.20
0.005127 0.006686
Output for 5.4.19
0.005231 0.007126
Output for 5.4.18
0.008050 0.006705
Output for 5.4.17
0.007011 0.006718
Output for 5.4.16
0.005063 0.006743
Output for 5.4.15
0.005492 0.006708
Output for 5.4.14
0.005188 0.006846
Output for 5.4.13
0.004098 0.006640
Output for 5.4.12
0.007968 0.007721
Output for 5.4.11
0.008609 0.006766
Output for 5.4.10
0.006425 0.007822
Output for 5.4.9
0.005293 0.007685
Output for 5.4.8
0.005971 0.007189
Output for 5.4.7
0.007738 0.006610
Output for 5.4.6
0.006347 0.007295
Output for 5.4.5
0.006435 0.008483
Output for 5.4.4
0.005720 0.008467
Output for 5.4.3
0.005155 0.006948
Output for 5.4.2
0.007273 0.007457
Output for 5.4.1
0.004495 0.007099
Output for 5.4.0
0.006003 0.008310
Output for 5.3.29
0.008250 0.009820
Output for 5.3.28
0.010810 0.009652
Output for 5.3.27
0.007341 0.010042
Output for 5.3.26
0.009073 0.010004
Output for 5.3.25
0.007629 0.010188
Output for 5.3.24
0.008071 0.009897
Output for 5.3.23
0.012494 0.008937
Output for 5.3.22
0.008718 0.009759
Output for 5.3.21
0.007241 0.009981
Output for 5.3.20
0.008686 0.009786
Output for 5.3.19
0.009228 0.009000
Output for 5.3.18
0.008297 0.008996
Output for 5.3.17
0.009587 0.009039
Output for 5.3.16
0.009959 0.009912
Output for 5.3.15
0.008955 0.010084
Output for 5.3.14
0.009113 0.008965
Output for 5.3.13
0.010192 0.014521
Output for 5.3.12
0.010268 0.014579
Output for 5.3.11
0.010467 0.008968
Output for 5.3.10
0.011825 0.008963
Output for 5.3.9
0.009065 0.009977
Output for 5.3.8
0.008690 0.009915
Output for 5.3.7
0.010263 0.009219
Output for 5.3.6
0.008996 0.009398
Output for 5.3.5
0.007717 0.009839
Output for 5.3.4
0.010804 0.009069
Output for 5.3.3
0.008557 0.016781
Output for 5.3.2
0.012021 0.009115
Output for 5.3.1
0.011312 0.008984
Output for 5.3.0
0.009735 0.008937
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.3.11, 4.4.0 - 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.

preferences:
198.53 ms | 401 KiB | 325 Q