3v4l.org

run code in 300+ PHP versions simultaneously
<?php class String { private $string; public function __construct($string) { if (!is_string($string)) { throw new \InvalidArgumentException(); } $this->string = $string; } public function __toString() { return $this->string; } } for ($i = 0; $i < 100000; $i++) { $string = 'a'; }

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.0130.07321.08
5.6.210.0100.07020.71
5.6.200.0030.04718.29
5.6.190.0100.08320.55
5.6.180.0030.08720.64
5.6.170.0430.06720.47
5.6.160.0130.07020.54
5.6.150.0000.09318.16
5.6.140.0070.06318.23
5.6.130.0070.06018.28
5.6.120.0030.09320.99
5.6.110.0030.08021.10
5.6.100.0200.07321.05
5.6.90.0130.08321.11
5.6.80.0100.08020.38
5.6.70.0300.08020.38
5.5.350.0070.03720.46
5.5.340.0030.05017.98
5.5.330.0000.05020.30
5.5.320.0300.06720.35
5.5.310.0170.05020.41
5.5.300.0000.05717.97
5.5.290.0030.06317.98
5.5.280.0170.08020.76
5.5.270.0030.05320.76
5.5.260.0200.06020.94
5.5.250.0130.08720.69
5.5.240.0100.08020.04
5.4.450.0330.05019.53
5.4.440.0200.02019.32
5.4.430.0400.05019.27
5.4.420.0200.04019.54
5.4.410.0100.05718.80
5.4.400.0070.06318.77
5.4.390.0170.05318.79
5.4.380.0230.05718.74
5.4.370.0370.05718.76
5.4.360.0270.06018.79
5.4.350.0330.06318.77
5.4.340.0400.04318.81
5.4.320.0050.04112.50
5.4.310.0050.04312.50
5.4.300.0050.04312.50
5.4.290.0100.03712.50
5.4.280.0050.04412.40
5.4.270.0050.04712.40
5.4.260.0040.04512.40
5.4.250.0100.03712.40
5.4.240.0050.04012.40
5.4.230.0050.04612.39
5.4.220.0070.03912.39
5.4.210.0080.03912.39
5.4.200.0040.04212.39
5.4.190.0150.04712.40
5.4.180.0140.04812.39
5.4.170.0140.04712.41
5.4.160.0180.04412.40
5.4.150.0130.04912.39
5.4.140.0140.04812.08
5.4.130.0100.05212.07
5.4.120.0210.03912.02
5.4.110.0110.05312.02
5.4.100.0220.07112.02
5.4.90.0150.04712.02
5.4.80.0160.04512.02
5.4.70.0140.04612.02
5.4.60.0180.04312.02
5.4.50.0220.04012.02
5.4.40.0240.09812.00
5.4.30.0160.04712.00
5.4.20.0220.03812.00
5.4.10.0160.04612.00
5.4.00.0200.03911.49
5.3.290.0060.05212.80
5.3.280.0030.04612.71
5.3.270.0130.05612.72
5.3.260.0200.04912.72
5.3.250.0330.06412.72
5.3.240.0140.05712.72
5.3.230.0180.05012.71
5.3.220.0150.05112.68
5.3.210.0370.09012.68
5.3.200.0180.05012.68
5.3.190.0180.04912.67
5.3.180.0170.04912.68
5.3.170.0230.04312.67
5.3.160.0180.04812.68
5.3.150.0190.04612.67
5.3.140.0140.05112.66
5.3.130.0140.05312.65
5.3.120.0160.05112.65
5.3.110.0170.04912.66
5.3.100.0110.05612.14
5.3.90.0110.05412.12
5.3.80.0160.04912.11
5.3.70.0170.04912.11
5.3.60.0280.09812.09
5.3.50.0150.05112.04
5.3.40.0080.05712.04
5.3.30.0120.05412.01
5.3.20.0160.08011.78
5.3.10.0120.05011.74
5.3.00.0160.04811.72
5.2.170.0140.0419.22
5.2.160.0140.0419.22
5.2.150.0270.0619.21
5.2.140.0120.0449.22
5.2.130.0150.0409.18
5.2.120.0120.0429.17
5.2.110.0120.0749.19
5.2.100.0140.0409.18
5.2.90.0120.0429.18
5.2.80.0130.0429.17
5.2.70.0140.0419.17
5.2.60.0110.0449.13
5.2.50.0340.0829.09
5.2.40.0090.0469.07
5.2.30.0130.0419.04
5.2.20.0090.0469.05
5.2.10.0130.0418.95
5.2.00.0090.0458.80
5.1.60.0050.0428.09
5.1.50.0130.0368.09
5.1.40.0260.0848.07
5.1.30.0110.0438.41
5.1.20.0110.0418.45
5.1.10.0140.0388.16
5.1.00.0120.0388.16
5.0.50.0100.0446.64
5.0.40.0080.0446.50
5.0.30.0110.0566.32
5.0.20.0110.1046.29
5.0.10.0150.0376.26
5.0.00.0150.0496.25
4.4.90.0080.0174.77
4.4.80.0100.0154.75
4.4.70.0080.0174.75
4.4.60.0090.0164.76
4.4.50.0080.0164.77
4.4.40.0110.0244.71
4.4.30.0080.0174.75
4.4.20.0040.0214.85
4.4.10.0120.0134.85
4.4.00.0060.0304.76
4.3.110.0060.0194.67
4.3.100.0060.0194.67
4.3.90.0090.0154.64
4.3.80.0060.0284.58
4.3.70.0080.0164.63
4.3.60.0080.0164.63
4.3.50.0110.0144.63
4.3.40.0040.0304.54
4.3.30.0030.0203.30
4.3.20.0040.0193.29
4.3.10.0050.0183.24
4.3.00.0070.01315.17

preferences:
156.26 ms | 1394 KiB | 7 Q