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; } } //YES!! string type-hinting ! :p function test(string $var) { return strrev($var); } echo (new string('foo')).(new string('bar')).PHP_EOL; echo substr(new string('foobar'), 3, 2).PHP_EOL; var_dump(explode(new string(':'), new string('foo:bar'))); echo test(new string('foobarbaz')).PHP_EOL; echo test("pure string"); //fatal

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.4.230.4330.04019.04
5.4.220.3830.03319.09
5.4.210.3530.04319.18
5.4.200.3570.03718.86
5.4.190.2670.03718.93
5.4.180.0100.06719.13
5.4.170.4170.03719.16
5.4.160.2800.04019.07
5.4.150.3170.03719.02
5.4.140.3930.04016.30
5.4.130.4230.03316.49
5.4.120.3630.04016.52
5.4.110.4670.04016.52
5.4.100.4200.04016.48
5.4.90.4430.04016.49
5.4.80.3870.03016.45
5.4.70.3830.03716.50
5.4.60.4030.04016.29
5.4.50.4300.04016.52
5.4.40.4330.03316.18
5.4.30.4700.04016.41
5.4.20.4570.04016.39
5.4.10.3770.03716.41
5.4.00.4800.04315.98
5.3.280.3830.04314.75
5.3.270.0070.07714.50
5.3.260.3570.03014.62
5.3.250.2100.04314.50
5.3.240.4130.04014.62
5.3.230.3530.03714.60
5.3.220.3730.03714.46
5.3.210.4000.04714.62
5.3.200.4570.03314.57
5.3.190.4400.03314.59
5.3.180.4530.04014.48
5.3.170.4030.03314.58
5.3.160.3770.03714.59
5.3.150.3830.03714.61
5.3.140.4800.03014.48
5.3.130.4430.03314.71
5.3.120.4770.03714.62
5.3.110.4070.04714.59
5.3.100.3130.03714.05
5.3.90.4430.04014.02
5.3.80.4070.03714.09
5.3.70.3970.03313.91
5.3.60.4070.03713.93
5.3.50.3730.03313.85
5.3.40.3730.03314.11
5.3.30.3900.03313.83
5.3.20.4030.03013.79
5.3.10.4370.03713.81
5.3.00.3870.04013.64
5.2.170.3000.03311.16
5.2.160.2900.03011.15
5.2.150.2700.02311.15
5.2.140.3030.03311.15
5.2.130.3270.03311.18
5.2.120.3500.03011.27
5.2.110.3030.03011.17
5.2.100.3070.02711.16
5.2.90.3170.02711.13
5.2.80.2830.03011.00
5.2.70.3000.03011.15
5.2.60.3930.03711.05
5.2.50.3700.02711.16
5.2.40.3330.03010.96
5.2.30.2930.02711.04
5.2.20.2670.03310.96
5.2.10.2130.03310.86
5.2.00.0870.03310.77
5.1.60.2300.0239.96
5.1.50.2570.03010.05
5.1.40.2670.02010.04
5.1.30.3070.02710.29
5.1.20.3000.02310.31
5.1.10.3470.02710.03
5.1.00.3270.02710.23
5.0.50.1530.0208.58
5.0.40.1830.0208.55
5.0.30.1430.0308.22
5.0.20.1670.0208.34
5.0.10.2070.0208.21
5.0.00.1130.0338.21
4.4.90.1770.0135.83
4.4.80.1530.0135.81
4.4.70.1430.0175.78
4.4.60.1570.0175.81
4.4.50.1600.0235.87
4.4.40.1270.0235.79
4.4.30.1530.0135.83
4.4.20.1830.0205.87
4.4.10.1630.0135.89
4.4.00.1830.0235.86
4.3.110.1870.0235.77
4.3.100.1470.0175.79
4.3.90.1400.0205.69
4.3.80.1300.0275.76
4.3.70.1470.0175.72
4.3.60.1630.0135.69
4.3.50.1700.0235.82
4.3.40.1270.0235.66
4.3.30.0800.0234.99
4.3.20.0670.0174.99
4.3.10.0900.0204.99
4.3.00.0870.0234.99

preferences:
140.13 ms | 1394 KiB | 7 Q