3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Test; class String { private $string; public function __construct($string) { if (!is_string($string)) { throw new \InvalidArgumentException(); } $this->string = $string; } public function __toString() { return $this->string; } } class A { public function a(String $string) { return $string; } } $a = new A(); for ($i = 0; $i < 100000; $i++) { $string = new String('a'); $a->a($string); }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.6.280.0100.13321.10
5.6.210.0100.12320.70
5.6.200.0030.09318.22
5.6.190.0070.11320.64
5.6.180.0300.12020.64
5.6.170.0230.08720.50
5.6.160.0030.09020.50
5.6.150.0070.13318.18
5.6.140.0100.08318.27
5.6.130.0100.11718.15
5.6.120.0130.13020.97
5.6.110.0130.08321.09
5.6.100.0130.08020.98
5.6.90.0130.15020.98
5.6.80.0030.08320.29
5.6.70.0200.14320.52
5.5.350.0300.13320.39
5.5.340.0070.10318.05
5.5.330.0000.15320.13
5.5.320.0170.11020.13
5.5.310.0100.10020.34
5.5.300.0100.11318.07
5.5.290.0030.15318.03
5.5.280.0030.13720.66
5.5.270.0070.14320.77
5.5.260.0030.15020.80
5.5.250.0070.08720.71
5.5.240.0100.08320.27
5.4.450.0230.12319.18
5.4.440.0230.12319.48
5.4.430.0230.09719.50
5.4.420.0230.11719.19
5.4.410.0230.08019.27
5.4.400.0230.07319.00
5.4.390.0300.06719.09
5.4.380.0170.08019.22
5.4.370.0200.07719.22
5.4.360.0200.10719.00
5.4.350.0200.07719.09
5.4.340.0230.07319.31
5.4.320.0200.07718.85
5.4.310.0200.08018.85
5.4.300.0100.08718.96
5.4.290.0270.07019.31
5.4.280.0230.07718.86
5.4.270.0230.12019.06
5.4.260.0300.12319.20
5.4.250.0200.08019.33
5.4.240.0200.08318.85
5.4.230.0270.12319.20
5.4.220.0300.09719.13
5.4.210.0300.12319.13
5.4.200.0330.09318.97
5.4.190.0270.09719.30
5.4.180.0230.09318.86
5.4.170.0170.09719.13
5.4.160.0400.11719.11
5.4.150.0230.10019.20
5.4.140.0270.11316.36
5.4.130.0230.09716.48
5.4.120.0330.11716.33
5.4.110.0400.11016.50
5.4.100.0170.10716.41
5.4.90.0270.09316.50
5.4.80.0330.08316.59
5.4.70.0270.07316.59
5.4.60.0300.12016.34
5.4.50.0230.12316.34
5.4.40.0230.13016.25
5.4.30.0270.08316.34
5.4.20.0270.07316.48
5.4.10.0200.08316.42
5.4.00.0270.12715.96
5.3.290.0170.10014.89
5.3.280.0300.11014.59
5.3.270.0270.15014.77
5.3.260.0200.15714.74
5.3.250.0300.16014.53
5.3.240.0300.14714.51
5.3.230.0170.12314.75
5.3.220.0300.11014.51
5.3.210.0200.10314.54
5.3.200.0300.10714.57
5.3.190.0300.11014.49
5.3.180.0230.11714.78
5.3.170.0300.13014.64
5.3.160.0230.15314.49
5.3.150.0230.16014.57
5.3.140.0200.11014.60
5.3.130.0230.11014.48
5.3.120.0330.11314.59
5.3.110.0270.14314.56
5.3.100.0270.09314.01
5.3.90.0230.12014.06
5.3.80.0270.12014.04
5.3.70.0300.13314.04
5.3.60.0230.15314.05
5.3.50.0230.14013.88
5.3.40.0370.12713.87
5.3.30.0300.09313.99
5.3.20.0230.07713.61
5.3.10.0330.06313.63
5.3.00.0300.04713.72
5.2.170.0130.06712.02
5.2.160.0200.03012.02
5.2.150.0200.04312.02
5.2.140.0230.05012.02
5.2.130.0200.04312.02
5.2.120.0200.06012.02
5.2.110.0230.06012.02
5.2.100.0270.05012.02
5.2.90.0200.06012.02
5.2.80.0270.05712.02
5.2.70.0270.05312.02
5.2.60.0230.03712.02
5.2.50.0270.04712.02
5.2.40.0200.04712.02
5.2.30.0200.03012.02
5.2.20.0130.04012.02
5.2.10.0170.03312.02
5.2.00.0230.04012.02
5.1.60.0300.02012.02
5.1.50.0130.03712.02
5.1.40.0230.03712.02
5.1.30.0200.05712.02
5.1.20.0230.05012.02
5.1.10.0230.02711.96
5.1.00.0170.03311.96
5.0.50.0130.04011.96
5.0.40.0130.04311.96
5.0.30.0130.06011.96
5.0.20.0130.04011.96
5.0.10.0070.03711.96
5.0.00.0130.04311.96
4.4.90.0030.03312.02
4.4.80.0130.01712.02
4.4.70.0100.02312.02
4.4.60.0100.02012.02
4.4.50.0100.01712.02
4.4.40.0100.03012.02
4.4.30.0070.02712.02
4.4.20.0170.02711.96
4.4.10.0130.01711.96
4.4.00.0130.02711.96
4.3.110.0100.03711.96
4.3.100.0100.01711.96
4.3.90.0200.02311.96
4.3.80.0070.03311.96
4.3.70.0070.03711.96
4.3.60.0100.02011.96
4.3.50.0170.02711.96
4.3.40.0100.04711.96
4.3.30.0030.02311.96
4.3.20.0030.01711.96
4.3.10.0030.04011.96
4.3.00.0030.01711.96

preferences:
137.52 ms | 1394 KiB | 7 Q