3v4l.org

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

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.0070.11321.12
5.6.250.0000.13020.78
5.6.240.0130.11320.58
5.6.230.0130.10320.70
5.6.220.0030.07320.75
5.6.210.0130.07020.65
5.6.200.0070.07021.06
5.6.190.0030.08021.03
5.6.180.0130.12720.96
5.6.170.0070.06321.14
5.6.160.0030.07321.14
5.6.150.0030.08021.17
5.6.140.0030.06721.00
5.6.130.0000.10720.93
5.6.120.0130.07021.01
5.6.110.0070.09321.00
5.6.100.0070.06721.13
5.6.90.0030.07020.99
5.6.80.0000.07320.56
5.6.70.0070.06320.32
5.6.60.0030.12720.41
5.6.50.0030.07020.53
5.6.40.0030.07320.38
5.6.30.0030.06720.54
5.6.20.0000.07320.49
5.6.10.0030.08020.44
5.6.00.0030.10320.48
5.5.380.0070.08320.37
5.5.370.0030.13320.38
5.5.360.0030.11720.42
5.5.350.0030.07020.47
5.5.340.0100.06020.84
5.5.330.0000.07320.90
5.5.320.0030.12720.88
5.5.310.0030.11020.81
5.5.300.0170.06020.80
5.5.290.0070.06720.73
5.5.280.0070.06720.88
5.5.270.0000.07320.83
5.5.260.0100.08720.83
5.5.250.0030.07020.71
5.5.240.0070.07020.25
5.5.230.0030.08020.27
5.5.220.0100.06020.14
5.5.210.0070.06720.15
5.5.200.0100.06320.29
5.5.190.0030.07020.16
5.5.180.0030.08720.28
5.5.160.0030.11320.16
5.5.150.0200.11020.15
5.5.140.0130.10720.24
5.5.130.0030.07020.16
5.5.120.0070.12320.19
5.5.110.0000.13720.25
5.5.100.0030.13020.14
5.5.90.0030.13720.09
5.5.80.0000.07720.05
5.5.70.0030.09320.06
5.5.60.0100.12020.04
5.5.50.0070.12720.03
5.5.40.0030.11020.09
5.5.30.0030.09319.93
5.5.20.0100.12320.15
5.5.10.0030.12720.02
5.5.00.0130.11020.00
5.4.450.0030.07019.45
5.4.440.0100.09019.20
5.4.430.0100.06319.57
5.4.420.0030.07019.28
5.4.410.0030.07719.22
5.4.400.0030.07319.03
5.4.390.0030.06719.05
5.4.380.0130.05319.20
5.4.370.0030.06718.94
5.4.360.0070.06319.21
5.4.350.0070.06319.02
5.4.340.0030.08718.95
5.4.320.0000.11318.95
5.4.310.0070.12018.90
5.4.300.0030.07018.84
5.4.290.0070.10319.18
5.4.280.0070.08019.12
5.4.270.0170.10319.10
5.4.260.0130.10318.89
5.4.250.0100.08019.05
5.4.240.0030.11318.84
5.4.230.0130.11019.04
5.4.220.0070.06719.04
5.4.210.0070.12319.20
5.4.200.0100.10319.15
5.4.190.0230.08318.88
5.4.180.0070.11718.86
5.4.170.0070.10019.17
5.4.160.0170.08319.23
5.4.150.0070.11019.00
5.4.140.0070.11016.19
5.4.130.0100.08316.41
5.4.120.0070.11716.42
5.4.110.0130.11316.44
5.4.100.0070.09316.47
5.4.90.0070.09716.40
5.4.80.0100.11016.25
5.4.70.0170.10016.37
5.4.60.0030.12016.24
5.4.50.0100.11316.36
5.4.40.0030.09316.55
5.4.30.0030.12316.29
5.4.20.0130.10016.43
5.4.10.0070.12016.39
5.4.00.0130.11015.71
5.3.290.0070.15314.62
5.3.280.0100.13314.70
5.3.270.0070.13014.56
5.3.260.0070.12714.67
5.3.250.0130.13714.66
5.3.240.0070.13314.66
5.3.230.0170.14014.62
5.3.220.0000.11314.64
5.3.210.0030.08714.63
5.3.200.0130.13714.54
5.3.190.0100.14714.57
5.3.180.0070.14314.62
5.3.170.0100.10714.54
5.3.160.0030.14714.63
5.3.150.0100.13014.57
5.3.140.0100.13714.62
5.3.130.0070.14014.66
5.3.120.0000.13314.67
5.3.110.0130.11714.66
5.3.100.0070.10314.18
5.3.90.0070.13314.11
5.3.80.0030.15714.08
5.3.70.0070.14014.04
5.3.60.0070.14313.98
5.3.50.0170.14013.90
5.3.40.0100.09713.87
5.3.30.0070.14714.01
5.3.20.0100.12313.75
5.3.10.0000.09713.79
5.3.00.0100.14313.57
5.2.170.0030.14311.16
5.2.160.0000.13311.27
5.2.150.0000.09711.24
5.2.140.0030.13011.23
5.2.130.0030.14011.16
5.2.120.0100.14311.03
5.2.110.0000.16311.18
5.2.100.0030.11311.20
5.2.90.0030.13711.13
5.2.80.0070.14011.00
5.2.70.0000.15311.23
5.2.60.0070.12311.17
5.2.50.0070.15011.16
5.2.40.0170.11011.12
5.2.30.0030.14310.98
5.2.20.0030.14311.03
5.2.10.0000.11310.88
5.2.00.0000.11710.63
5.1.60.0030.1409.99
5.1.50.0030.14010.01
5.1.40.0030.1609.97
5.1.30.0030.14710.29
5.1.20.0000.10010.40
5.1.10.0100.13010.16
5.1.00.0100.12310.13
5.0.50.0030.1338.62
5.0.40.0000.1608.47
5.0.30.0000.1708.30
5.0.20.0000.1738.32
5.0.10.0030.1538.21
5.0.00.0070.1608.21
4.4.90.0030.0378.21
4.4.80.0000.0378.21
4.4.70.0070.0338.21
4.4.60.0000.0408.21
4.4.50.0070.0378.21
4.4.40.0030.0538.21
4.4.30.0000.0308.21
4.4.20.0000.0378.21
4.4.10.0030.0178.21
4.4.00.0030.0578.21
4.3.110.0000.0338.21
4.3.100.0030.0338.21
4.3.90.0000.0338.21
4.3.80.0070.0308.21
4.3.70.0000.0378.21
4.3.60.0070.0308.21
4.3.50.0000.0378.21
4.3.40.0030.0508.21
4.3.30.0000.0378.21
4.3.20.0000.0278.21
4.3.10.0000.0338.21
4.3.00.0000.0338.21

preferences:
142.23 ms | 1394 KiB | 7 Q