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) { return $string; } } $a = new A(); for ($i = 0; $i < 100000; $i++) { $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.0030.09021.07
5.6.210.0030.10020.76
5.6.200.0130.09018.16
5.6.190.0030.05320.57
5.6.180.0000.09020.39
5.6.170.0270.08720.56
5.6.160.0070.09720.39
5.6.150.0100.08718.12
5.6.140.0100.05018.24
5.6.130.0100.04718.18
5.6.120.0030.10020.95
5.6.110.0030.09020.89
5.6.100.0070.05020.99
5.6.90.0070.09720.98
5.6.80.0170.07320.49
5.6.70.3630.05020.44
5.5.350.0000.10720.43
5.5.340.0100.07018.02
5.5.330.0030.08720.43
5.5.320.0100.09320.42
5.5.310.0300.05720.37
5.5.300.0100.09017.93
5.5.290.0170.08717.98
5.5.280.0070.10320.69
5.5.270.0000.05320.96
5.5.260.0100.06020.87
5.5.250.0100.09320.72
5.5.240.0070.09020.27
5.4.450.0570.04319.57
5.4.440.0970.07319.36
5.4.430.0300.07019.21
5.4.420.0330.07319.32
5.4.410.0800.09719.45
5.4.400.1030.09018.89
5.4.390.1530.06018.80
5.4.380.0170.08318.78
5.4.370.0100.07718.62
5.4.360.0170.08318.79
5.4.350.0230.06018.73
5.4.340.0170.06018.70
5.4.320.0080.04712.50
5.4.310.0080.05212.50
5.4.300.0070.05112.50
5.4.290.0060.05912.50
5.4.280.0080.05512.40
5.4.270.0050.04712.40
5.4.260.0090.04912.40
5.4.250.0090.04612.39
5.4.240.0070.04812.40
5.4.230.0070.04712.39
5.4.220.0090.05312.39
5.4.210.0060.04512.39
5.4.200.0080.05812.39
5.4.190.0130.06212.39
5.4.180.0200.05812.40
5.4.170.0180.05612.41
5.4.160.0150.06012.40
5.4.150.0200.05212.39
5.4.140.0170.05412.08
5.4.130.0210.05212.06
5.4.120.0100.06112.02
5.4.110.0120.05912.02
5.4.100.0140.05912.02
5.4.90.0360.09712.02
5.4.80.0140.05612.02
5.4.70.0160.05312.02
5.4.60.0120.05812.02
5.4.50.0160.05812.02
5.4.40.0240.07712.00
5.4.30.0160.06012.00
5.4.20.0170.05412.00
5.4.10.0150.05912.00
5.4.00.0320.10311.49
5.3.290.0040.06312.80
5.3.280.0120.07812.70
5.3.270.0170.07112.72
5.3.260.0140.07212.72
5.3.250.0150.07412.72
5.3.240.0360.10612.72
5.3.230.0140.07312.70
5.3.220.0170.06912.68
5.3.210.0200.06612.68
5.3.200.0180.06012.68
5.3.190.0160.07112.67
5.3.180.0150.06512.68
5.3.170.0140.06912.67
5.3.160.0180.06512.68
5.3.150.0190.09312.68
5.3.140.0150.07112.66
5.3.130.0190.06012.66
5.3.120.0300.10912.66
5.3.110.0150.06712.66
5.3.100.0180.06612.14
5.3.90.0130.06812.12
5.3.80.0160.06312.11
5.3.70.0120.06912.11
5.3.60.0180.06312.10
5.3.50.0180.06312.04
5.3.40.0180.10012.04
5.3.30.0170.06212.01
5.3.20.0100.06911.78
5.3.10.0210.05911.75
5.3.00.0130.06911.73
5.2.170.0140.0329.18
5.2.160.0080.0389.18
5.2.150.0290.0489.18
5.2.140.0130.0339.18
5.2.130.0090.0379.14
5.2.120.0130.0339.14
5.2.110.0130.0349.14
5.2.100.0140.0329.14
5.2.90.0140.0319.14
5.2.80.0140.0329.13
5.2.70.0130.0349.13
5.2.60.0260.0519.09
5.2.50.0120.0359.05
5.2.40.0290.0789.04
5.2.30.0110.0359.01
5.2.20.0140.0329.01
5.2.10.0150.0318.92
5.2.00.0100.0358.78
5.1.60.0100.0298.07
5.1.50.0090.0328.06
5.1.40.0100.0308.05
5.1.30.0090.0338.39
5.1.20.0150.0278.43
5.1.10.0140.0288.14
5.1.00.0360.0658.15
5.0.50.0080.0256.62
5.0.40.0110.0206.48
5.0.30.0080.0356.29
5.0.20.0050.0266.27
5.0.10.0060.0256.24
5.0.00.0090.0346.23
4.4.90.0070.0184.78
4.4.80.0070.0174.75
4.4.70.0090.0164.76
4.4.60.0060.0194.75
4.4.50.0060.0194.77
4.4.40.0070.0284.71
4.4.30.0070.0204.76
4.4.20.0100.0154.85
4.4.10.0100.0154.84
4.4.00.0060.0304.76
4.3.110.0080.0174.67
4.3.100.0080.0164.67
4.3.90.0070.0174.64
4.3.80.0080.0264.58
4.3.70.0090.0154.63
4.3.60.0230.0624.63
4.3.50.0100.0144.62
4.3.40.0110.0224.53
4.3.30.0060.0173.29
4.3.20.0040.0193.28
4.3.10.0050.0173.24
4.3.00.0030.01715.48

preferences:
141.91 ms | 1394 KiB | 7 Q