3v4l.org

run code in 300+ PHP versions simultaneously
<?php class string { protected $string = null; public function __construct($string) { $this->string=(string)$string; } public function __toString() { return $this->string; } } function foo(string $bar) { echo $bar; } $string = new string("i am a string!"); foo($string); echo (new string('foo')).(new string('bar'));

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.06721.04
5.6.210.0000.08720.51
5.6.200.0070.04718.18
5.6.190.0000.05320.34
5.6.180.0330.04320.63
5.6.170.0300.07320.52
5.6.160.0070.06720.47
5.6.150.0130.04018.23
5.6.140.0070.06318.14
5.6.130.0100.08018.12
5.6.120.0130.08021.14
5.6.110.0070.08321.05
5.6.100.0030.06321.14
5.6.90.0000.09320.98
5.6.80.0030.04020.39
5.6.70.3400.04020.54
5.5.350.0130.06720.48
5.5.340.0070.03317.94
5.5.330.0030.05320.30
5.5.320.0070.08020.34
5.5.310.0300.06320.27
5.5.300.0070.05718.04
5.5.290.0030.04018.07
5.5.280.0070.04320.77
5.5.270.0000.04720.87
5.5.260.0100.08020.68
5.5.250.0100.04020.79
5.5.240.0330.07020.37
5.4.450.0000.06019.45
5.4.440.0000.04319.49
5.4.430.0100.03719.30
5.4.420.0000.04019.52
5.4.410.0030.03719.34
5.4.400.0030.03718.93
5.4.390.0130.02719.25
5.4.380.0070.04019.00
5.4.370.0000.04318.85
5.4.360.0000.04319.15
5.4.350.0100.03019.24
5.4.340.0030.03719.15
5.4.320.0100.03019.08
5.4.310.0030.03718.87
5.4.300.0030.03719.04
5.4.290.0000.04318.98
5.4.280.0000.04319.08
5.4.270.0100.03019.24
5.4.260.0030.03719.14
5.4.250.0030.03719.14
5.4.240.0030.04018.84
5.4.230.0000.05319.16
5.4.220.0130.04018.91
5.4.210.0030.07719.11
5.4.200.0070.06318.92
5.4.190.0070.04719.21
5.4.180.0070.07718.98
5.4.170.0100.07718.86
5.4.160.0100.04718.85
5.4.150.0070.08019.14
5.4.140.0070.06716.47
5.4.130.0100.06316.59
5.4.120.0070.05316.42
5.4.110.0070.04316.54
5.4.100.0070.07316.47
5.4.90.0100.06016.38
5.4.80.0000.07016.41
5.4.70.0100.06716.48
5.4.60.0030.06716.38
5.4.50.0100.03316.27
5.4.40.0100.06716.27
5.4.30.0170.06016.32
5.4.20.0000.07016.40
5.4.10.0070.03716.43
5.4.00.0070.04715.86
5.3.290.0030.04014.73
5.3.280.0100.06314.52
5.3.270.0070.07714.63
5.3.260.0100.06714.64
5.3.250.0030.06014.63
5.3.240.0000.06014.68
5.3.230.0100.04014.60
5.3.220.0000.08714.57
5.3.210.0100.06314.57
5.3.200.0100.07014.58
5.3.190.0030.07014.59
5.3.180.0070.05314.72
5.3.170.0070.04714.61
5.3.160.0100.07014.59
5.3.150.0000.06314.72
5.3.140.0070.07314.58
5.3.130.0030.06314.43
5.3.120.0070.07714.46
5.3.110.0070.07014.55
5.3.100.0100.07014.03
5.3.90.0000.04714.05
5.3.80.0100.07014.20
5.3.70.0100.07314.02
5.3.60.0100.05314.01
5.3.50.0070.08313.85
5.3.40.0100.04013.95
5.3.30.0030.05313.96
5.3.20.0070.04013.75
5.3.10.0100.05013.66
5.3.00.0100.05713.64
5.2.170.0070.04711.16
5.2.160.0030.03711.12
5.2.150.0030.06311.15
5.2.140.0000.05011.15
5.2.130.0100.03011.12
5.2.120.0030.04011.03
5.2.110.0100.04711.11
5.2.100.0030.04311.17
5.2.90.0000.04711.07
5.2.80.0100.04311.18
5.2.70.0030.05011.12
5.2.60.0070.03311.04
5.2.50.0070.05710.98
5.2.40.0000.06310.92
5.2.30.0100.05311.02
5.2.20.0000.04011.12
5.2.10.0070.03310.92
5.2.00.0130.05310.70
5.1.60.0030.03310.02
5.1.50.0030.03010.00
5.1.40.0030.03310.14
5.1.30.0070.05710.39
5.1.20.0100.05010.28
5.1.10.0030.0409.98
5.1.00.0070.05310.10
5.0.50.0000.0338.52
5.0.40.0070.0408.50
5.0.30.0030.0678.38
5.0.20.0000.0238.22
5.0.10.0000.0478.08
5.0.00.0030.0638.13
4.4.90.0030.0178.02
4.4.80.0000.0178.02
4.4.70.0070.0308.02
4.4.60.0030.0338.02
4.4.50.0000.0308.02
4.4.40.0030.0238.02
4.4.30.0030.0178.02
4.4.20.0070.0208.02
4.4.10.0000.0378.02
4.4.00.0000.0308.02
4.3.110.0100.0178.02
4.3.100.0070.0178.02
4.3.90.0000.0278.02
4.3.80.0070.0478.02
4.3.70.0030.0338.02
4.3.60.0000.0378.02
4.3.50.0030.0378.02
4.3.40.0000.0538.02
4.3.30.0000.0178.02
4.3.20.0000.0408.02
4.3.10.0000.0378.02
4.3.00.0000.0338.02

preferences:
141.92 ms | 1394 KiB | 7 Q