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; } } //echo (new string('foo')).(new string('bar')); echo substr(new string('foobar'), 3, 2);

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.210.0070.07320.77
5.6.200.0130.07718.18
5.6.190.0030.04318.19
5.6.180.0100.07718.19
5.6.170.0030.06318.28
5.6.160.0030.08018.28
5.6.150.0130.07318.19
5.6.140.0030.05318.17
5.6.130.0030.06718.28
5.6.120.0070.04018.16
5.6.110.0130.04018.17
5.6.100.0070.08718.18
5.6.90.0170.07018.26
5.6.80.0070.06317.58
5.6.70.0130.05017.61
5.6.60.0030.04317.55
5.6.50.0030.08017.60
5.6.40.0070.07717.54
5.6.30.0070.08017.54
5.6.20.0170.06717.54
5.6.10.0030.08317.50
5.6.00.0030.07317.52
5.5.350.0300.08320.50
5.5.340.0030.08318.05
5.5.330.0070.08318.05
5.5.320.0070.04017.92
5.5.310.0130.06318.08
5.5.300.0000.07317.95
5.5.290.0070.04018.08
5.5.280.0030.04318.04
5.5.270.0200.06717.91
5.5.260.0000.05017.97
5.5.250.0100.03717.76
5.5.240.0070.05017.37
5.5.230.0070.08017.35
5.5.220.0030.06017.32
5.5.210.0070.07317.46
5.5.200.0100.04017.34
5.5.190.0030.08317.37
5.5.180.0100.07317.30
5.5.160.0070.07717.42
5.5.150.0030.08317.39
5.5.140.0070.07317.32
5.5.130.0030.07317.36
5.5.120.0070.04717.29
5.5.110.0030.08017.32
5.5.100.0070.07017.19
5.5.90.0030.07717.20
5.5.80.0030.08317.27
5.5.70.0100.07317.22
5.5.60.0130.06717.17
5.5.50.0100.05317.26
5.5.40.0070.07717.22
5.5.30.0030.06317.32
5.5.20.0100.04317.20
5.5.10.0070.04017.21
5.5.00.0070.04717.25
5.4.450.0000.04719.29
5.4.440.0100.03319.35
5.4.430.0030.04719.33
5.4.420.0030.06719.30
5.4.410.0030.06319.24
5.4.400.0100.08019.02
5.4.390.0070.04718.96
5.4.380.0070.05319.13
5.4.370.0070.07019.05
5.4.360.0170.06019.23
5.4.350.0100.07719.10
5.4.340.0030.06018.98
5.4.320.0170.06719.27
5.4.310.0130.07718.89
5.4.300.0200.06718.98
5.4.290.0100.07719.03
5.4.280.0100.06319.13
5.4.270.0030.07319.01
5.4.260.0030.08019.09
5.4.250.0070.04319.26
5.4.240.0100.07019.13
5.4.230.0130.06719.12
5.4.220.0030.04019.02
5.4.210.0100.07019.00
5.4.200.0200.03718.98
5.4.190.0100.07719.08
5.4.180.0030.08319.11
5.4.170.0070.04019.00
5.4.160.0030.07719.13
5.4.150.0100.03718.96
5.4.140.0030.04016.30
5.4.130.0100.06716.39
5.4.120.0100.07316.41
5.4.110.0030.06316.59
5.4.100.0030.03316.55
5.4.90.0000.03716.23
5.4.80.0000.04016.22
5.4.70.0030.03316.37
5.4.60.0000.03716.38
5.4.50.0000.03716.46
5.4.40.0030.03316.62
5.4.30.0100.02716.53
5.4.20.0070.03016.56
5.4.10.0000.03716.48
5.4.00.0000.03715.83
5.3.290.0070.08314.72
5.3.280.0100.07014.64
5.3.270.0000.04714.62
5.3.260.0030.05314.64
5.3.250.0030.04314.64
5.3.240.0000.04314.63
5.3.230.0000.07314.45
5.3.220.0030.05714.52
5.3.210.0070.06014.56
5.3.200.0030.04014.59
5.3.190.0000.04014.78
5.3.180.0030.04014.56
5.3.170.0000.04014.67
5.3.160.0000.04014.79
5.3.150.0000.04014.61
5.3.140.0200.03014.41
5.3.130.0070.03314.55
5.3.120.0070.03314.40
5.3.110.0100.03014.61
5.3.100.0030.03714.25
5.3.90.0070.03314.06
5.3.80.0070.03313.99
5.3.70.0030.03314.07
5.3.60.0100.02714.21
5.3.50.0000.03713.93
5.3.40.0000.03713.94
5.3.30.0000.03713.96
5.3.20.0030.03713.76
5.3.10.0030.03313.68
5.3.00.0030.03313.66
5.2.170.0000.03011.16
5.2.160.0070.02311.15
5.2.150.0000.03011.15
5.2.140.0030.02711.15
5.2.130.0070.02311.07
5.2.120.0030.02711.00
5.2.110.0100.02011.15
5.2.100.0030.02711.31
5.2.90.0030.02711.13
5.2.80.0030.02711.16
5.2.70.0030.02711.13
5.2.60.0000.03011.26
5.2.50.0030.02711.04
5.2.40.0100.02011.05
5.2.30.0030.03710.88
5.2.20.0070.02310.93
5.2.10.0030.02711.07
5.2.00.0070.02310.77
5.1.60.0030.02310.04
5.1.50.0000.0279.96
5.1.40.0000.02710.04
5.1.30.0030.02310.38
5.1.20.0030.02310.56
5.1.10.0030.02310.06
5.1.00.0000.02710.06
5.0.50.0030.0338.54
5.0.40.0030.0438.37
5.0.30.0030.0678.20
5.0.20.0030.0308.29
5.0.10.0070.0238.00
5.0.00.0000.0608.12
4.4.90.0000.0177.79
4.4.80.0000.0137.79
4.4.70.0030.0137.79
4.4.60.0000.0177.79
4.4.50.0030.0137.79
4.4.40.0000.0237.79
4.4.30.0030.0137.79
4.4.20.0000.0207.79
4.4.10.0000.0237.79
4.4.00.0030.0277.79
4.3.110.0030.0337.79
4.3.100.0000.0337.79
4.3.90.0070.0177.79
4.3.80.0000.0407.79
4.3.70.0000.0377.79
4.3.60.0000.0237.79
4.3.50.0030.0337.79
4.3.40.0030.0537.79
4.3.30.0000.0337.79
4.3.20.0030.0377.79
4.3.10.0070.0337.79
4.3.00.0000.0377.79

preferences:
144.23 ms | 1394 KiB | 7 Q