3v4l.org

run code in 300+ PHP versions simultaneously
<?php class string { private $holder = null; public function __construct($x) { $this->holder = (string)$x; } public function __toString() { return $this->holder; } public function __call($name, $args) { return call_user_func_array($name, array_merge([$this->holder], $args)); } } var_dump((new string('foo'))->strlen(), strlen(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.06321.09
5.6.210.0070.08320.70
5.6.200.0130.05718.18
5.6.190.0000.07720.64
5.6.180.0270.03720.63
5.6.170.0230.04020.53
5.6.160.0030.09020.73
5.6.150.0130.06718.18
5.6.140.0070.07718.27
5.6.130.0030.04718.15
5.6.120.0070.06721.00
5.6.110.0070.08721.00
5.6.100.0100.05020.96
5.6.90.0130.07721.04
5.6.80.0030.07320.41
5.6.70.4400.04320.36
5.5.350.0200.03320.41
5.5.340.0070.05318.04
5.5.330.0100.03720.58
5.5.320.0200.04320.34
5.5.310.0300.07720.41
5.5.300.0100.07317.95
5.5.290.0030.08318.07
5.5.280.0070.05020.88
5.5.270.0200.07720.89
5.5.260.0100.08020.90
5.5.250.0100.08020.63
5.5.240.0330.06720.19
5.4.450.0800.05319.45
5.4.440.0700.06019.46
5.4.430.0030.06019.55
5.4.420.0670.05719.59
5.4.410.0800.07319.47
5.4.400.0730.06018.97
5.4.390.0970.04319.14
5.4.380.0370.05318.84
5.4.370.0300.06718.47
5.4.360.0330.05018.53
5.4.350.0230.06718.58
5.4.340.0300.05318.75
5.4.320.0050.03912.50
5.4.310.0040.04012.50
5.4.300.0080.03512.51
5.4.290.0080.03712.49
5.4.280.0080.03412.38
5.4.270.0040.04112.38
5.4.260.0090.04312.39
5.4.250.0140.04812.38
5.4.240.0070.05412.38
5.4.230.0150.05012.38
5.4.220.0080.05612.38
5.4.210.0100.05112.38
5.4.200.0050.04712.38
5.4.190.0130.03912.37
5.4.180.0100.03512.37
5.4.170.0080.03712.38
5.4.160.0100.04912.38
5.4.150.0090.04512.38
5.4.140.0100.04812.06
5.4.130.0100.04612.05
5.4.120.0110.05512.00
5.4.110.0090.05512.00
5.4.100.0110.06212.00
5.4.90.0100.05112.00
5.4.80.0170.05912.00
5.4.70.0120.05412.00
5.4.60.0050.05212.00
5.4.50.0070.06112.00
5.4.40.0080.03711.99
5.4.30.0100.03611.98
5.4.20.0090.05011.98
5.4.10.0100.05311.98
5.4.00.0050.05311.47
5.3.280.0120.05012.71
5.3.270.0100.05712.72
5.3.260.0110.05612.72
5.3.250.0090.05512.72
5.3.240.0070.04712.72
5.3.230.0070.04612.71
5.3.220.0120.05112.68
5.3.210.0170.05712.68
5.3.200.0120.05012.68
5.3.190.0100.04812.68
5.3.180.0080.03812.68
5.3.170.0070.03612.67
5.3.160.0100.03412.68
5.3.150.0080.05512.67
5.3.140.0070.05512.66
5.3.130.0180.04712.66
5.3.120.0130.05012.65
5.3.110.0060.04212.66
5.3.100.0120.03412.13
5.3.90.0090.05412.11
5.3.80.0100.04812.09
5.3.70.0110.04712.09
5.3.60.0120.04612.08
5.3.50.0070.03712.03
5.3.40.0110.03312.03
5.3.30.0080.04511.99
5.3.20.0050.03811.77
5.3.10.0070.04011.73
5.3.00.0070.05211.72
5.2.170.0100.0409.22
5.2.160.0070.0429.22
5.2.150.0090.0419.22
5.2.140.0050.0369.22
5.2.130.0090.0399.18
5.2.120.0090.0489.18
5.2.110.0080.0309.20
5.2.100.0050.0369.19
5.2.90.0070.0389.18
5.2.80.0030.0339.18
5.2.70.0050.0339.18
5.2.60.0060.0319.13
5.2.50.0060.0319.10
5.2.40.0070.0289.07
5.2.30.0090.0279.05
5.2.20.0060.0389.04
5.2.10.0060.0408.95
5.2.00.0100.0378.81
5.1.60.0080.0338.09
5.1.50.0090.0318.09
5.1.40.0050.0298.07
5.1.30.0050.0298.43
5.1.20.0090.0298.45
5.1.10.0050.0298.17
5.1.00.0040.0268.16
5.0.50.0040.0256.65
5.0.40.0070.0266.51
5.0.30.0060.0316.32
5.0.20.0050.0196.29
5.0.10.0050.0206.26
5.0.00.0050.0406.25
4.4.90.0050.0164.78
4.4.80.0020.0184.76
4.4.70.0040.0224.75
4.4.60.0050.0164.75
4.4.50.0010.0184.77
4.4.40.0010.0294.71
4.4.30.0020.0174.75
4.4.20.0020.0174.84
4.4.10.0030.0234.85
4.4.00.0060.0344.75
4.3.110.0080.0214.67
4.3.100.0040.0214.67
4.3.90.0020.0224.63
4.3.80.0020.0364.58
4.3.70.0050.0234.63
4.3.60.0040.0234.62
4.3.50.0050.0224.63
4.3.40.0060.0324.53
4.3.30.0040.0213.30
4.3.20.0040.0213.28
4.3.10.0030.0153.23
4.3.00.0300.01310.31

preferences:
147.14 ms | 1394 KiB | 7 Q