3v4l.org

run code in 300+ PHP versions simultaneously
<?php class String { public function __construct($s) { $this->payload = str_split($s); } public function __toString() { return implode($this->payload,''); } } function foo(String $a) { echo 'String: ' . $a; } 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.0070.07021.11
5.6.210.0000.08720.61
5.6.200.0030.06018.17
5.6.190.0100.08720.66
5.6.180.0070.07720.50
5.6.170.0270.08320.45
5.6.160.0170.06720.55
5.6.150.0130.06718.15
5.6.140.0030.08718.23
5.6.130.0030.04018.28
5.6.120.0070.08721.04
5.6.110.0070.07720.90
5.6.100.0230.05020.87
5.6.90.0000.07321.11
5.6.80.0170.07020.40
5.6.70.3130.03020.38
5.5.350.0030.08320.47
5.5.340.0030.08018.07
5.5.330.0130.07720.18
5.5.320.0000.06720.34
5.5.310.0270.06320.34
5.5.300.0130.04317.92
5.5.290.0070.06718.09
5.5.280.0100.03720.77
5.5.270.0100.05320.80
5.5.260.0170.04320.88
5.5.250.0170.07320.69
5.5.240.0070.08320.13
5.4.450.0100.04719.46
5.4.440.0430.05319.46
5.4.430.0430.04319.40
5.4.420.0330.04319.49
5.4.410.0330.03319.27
5.4.400.0230.04719.20
5.4.390.0500.04718.95
5.4.380.0130.06018.76
5.4.370.0170.05318.61
5.4.360.0170.05318.78
5.4.350.0170.05718.65
5.4.340.0230.04718.53
5.4.320.0090.03912.51
5.4.310.0060.04412.50
5.4.300.0080.03412.51
5.4.290.0050.03912.50
5.4.280.0050.03512.40
5.4.270.0060.03512.40
5.4.260.0100.03212.40
5.4.250.0080.03812.40
5.4.240.0060.03912.40
5.4.230.0100.03612.39
5.4.220.0070.03712.39
5.4.210.0110.03312.39
5.4.200.0070.03912.39
5.4.190.0040.03712.39
5.4.180.0050.03612.39
5.4.170.0050.03712.40
5.4.160.0090.03312.39
5.4.150.0050.03912.39
5.4.140.0070.03612.07
5.4.130.0030.03812.06
5.4.120.0060.03612.02
5.4.110.0070.03412.02
5.4.100.0040.03912.02
5.4.90.0080.03312.02
5.4.80.0030.03912.01
5.4.70.0080.03412.01
5.4.60.0050.03912.01
5.4.50.0070.03212.01
5.4.40.0060.03212.00
5.4.30.0040.03712.00
5.4.20.0070.03211.99
5.4.10.0080.03612.00
5.4.00.0060.03511.48
5.3.290.0070.04912.80
5.3.280.0060.05112.70
5.3.270.0040.04112.72
5.3.260.0060.03812.72
5.3.250.0080.03512.72
5.3.240.0040.04012.72
5.3.230.0010.04512.71
5.3.220.0060.03712.68
5.3.210.0040.04212.68
5.3.200.0040.03812.68
5.3.190.0080.04112.68
5.3.180.0080.03812.68
5.3.170.0080.03812.66
5.3.160.0100.03512.67
5.3.150.0050.03912.68
5.3.140.0040.03812.66
5.3.130.0060.03912.65
5.3.120.0050.03912.66
5.3.110.0040.04012.66
5.3.100.0050.03712.12
5.3.90.0050.03712.10
5.3.80.0070.03512.09
5.3.70.0050.03912.09
5.3.60.0110.03212.08
5.3.50.0050.04112.03
5.3.40.0060.03712.03
5.3.30.0050.03611.99
5.3.20.0070.03611.78
5.3.10.0080.03311.73
5.3.00.0040.03911.72
5.2.170.0040.0319.22
5.2.160.0050.0429.22
5.2.150.0060.0369.22
5.2.140.0060.0309.22
5.2.130.0060.0299.18
5.2.120.0030.0309.18
5.2.110.0030.0329.19
5.2.100.0040.0309.18
5.2.90.0060.0289.19
5.2.80.0050.0309.18
5.2.70.0050.0309.18
5.2.60.0040.0359.13
5.2.50.0050.0309.10
5.2.40.0060.0289.08
5.2.30.0040.0309.05
5.2.20.0060.0289.04
5.2.10.0030.0318.94
5.2.00.0050.0298.81
5.1.60.0060.0228.09
5.1.50.0100.0288.09
5.1.40.0040.0258.07
5.1.30.0050.0378.42
5.1.20.0050.0328.45
5.1.10.0030.0288.16
5.1.00.0050.0258.17
5.0.50.0060.0196.65
5.0.40.0050.0196.50
5.0.30.0030.0326.32
5.0.20.0030.0256.29
5.0.10.0030.0206.26
5.0.00.0030.0336.25
4.4.90.0050.0154.78
4.4.80.0030.0174.75
4.4.70.0020.0164.75
4.4.60.0020.0164.76
4.4.50.0030.0154.77
4.4.40.0030.0244.71
4.4.30.0010.0174.76
4.4.20.0030.0214.84
4.4.10.0060.0124.85
4.4.00.0020.0264.76
4.3.110.0050.0164.67
4.3.100.0040.0134.66
4.3.90.0030.0144.64
4.3.80.0040.0234.59
4.3.70.0050.0124.63
4.3.60.0030.0144.63
4.3.50.0030.0154.63
4.3.40.0050.0224.54
4.3.30.0030.0143.30
4.3.20.0030.0153.28
4.3.10.0020.0153.23
4.3.00.0130.01714.79

preferences:
142.61 ms | 1394 KiB | 7 Q