3v4l.org

run code in 300+ PHP versions simultaneously
<?php $code =<<<EOC <?php /* * This file is part of the Redaktilo project. * * (c) Loïc Chardonnet <loic.chardonnet@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Gnugat\Redaktilo\Replace; use Gnugat\Redaktilo\Converter\LineContentConverter; use Gnugat\Redaktilo\File; /** * This strategy manipulates lines stripped of their line break character. * * @api */ class LineReplaceStrategy implements ReplaceStrategy { /** @var LineContentConverter */ private $converter; /** @param LineContentConverter */ public function __construct(LineContentConverter $converter) { $this->converter = $converter; } /** {@inheritdoc} */ public function supports($location) { return (is_int($location) && $location >= 0); } /** {@inheritdoc} */ public function removeAt(File $file, $location) { $lines = $this->converter->from($file); unset($lines[$location]); $this->converter->back($file, $lines); } /** {@inheritdoc} */ public function replaceWith(File $file, $location, $replacement) { $lines = $this->converter->from($file); $lines[$location] = $replacement; $this->converter->back($file, $lines); } /** {@inheritdoc} */ public function insertAt(File $file, $location, $addition) { $lines = $this->converter->from($file); array_splice($lines, $location, 0, $addition); $this->converter->back($file, $lines); } } EOC; var_dump(token_get_all($code));

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)
8.3.60.0120.00316.63
8.3.50.0150.00521.13
8.3.40.0090.00618.85
8.3.30.0030.01118.93
8.3.20.0040.00420.30
8.3.10.0040.00423.53
8.3.00.0040.00419.13
8.2.180.0130.00616.50
8.2.170.0090.00922.96
8.2.160.0030.01020.35
8.2.150.0000.00724.18
8.2.140.0050.00324.66
8.2.130.0110.00826.16
8.2.120.0040.00422.20
8.2.110.0000.00820.39
8.2.100.0080.00417.91
8.2.90.0050.00319.21
8.2.80.0000.00917.97
8.2.70.0000.00917.63
8.2.60.0040.00417.80
8.2.50.0050.00318.07
8.2.40.0000.00818.16
8.2.30.0000.00718.11
8.2.20.0000.00717.84
8.2.10.0030.00618.10
8.2.00.0000.01117.85
8.1.280.0030.01225.92
8.1.270.0030.00622.16
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0110.00017.35
8.1.230.0090.00320.84
8.1.220.0040.00417.74
8.1.210.0050.00318.77
8.1.200.0100.00017.23
8.1.190.0080.00017.10
8.1.180.0030.00518.10
8.1.170.0000.00918.65
8.1.160.0050.00321.96
8.1.150.0040.00418.57
8.1.140.0000.00717.38
8.1.130.0040.00417.81
8.1.120.0030.00517.30
8.1.110.0000.00817.27
8.1.100.0000.00717.39
8.1.90.0040.00417.27
8.1.80.0000.00717.29
8.1.70.0000.00717.33
8.1.60.0000.00917.56
8.1.50.0040.00417.43
8.1.40.0000.00817.47
8.1.30.0030.00517.58
8.1.20.0000.00817.50
8.1.10.0000.00717.55
8.1.00.0000.00717.55
8.0.300.0070.00018.77
8.0.290.0040.00416.75
8.0.280.0000.00718.46
8.0.270.0000.00717.38
8.0.260.0000.00617.21
8.0.250.0070.00017.14
8.0.240.0000.00817.02
8.0.230.0030.00317.02
8.0.220.0030.00316.78
8.0.210.0000.00716.88
8.0.200.0030.00317.04
8.0.190.0040.00417.02
8.0.180.0000.00716.97
8.0.170.0080.00016.95
8.0.160.0030.00317.02
8.0.150.0000.00716.95
8.0.140.0030.00416.80
8.0.130.0030.00313.46
8.0.120.0080.00016.82
8.0.110.0040.00416.85
8.0.100.0030.00316.88
8.0.90.0040.00416.78
8.0.80.0150.00616.89
8.0.70.0070.00017.00
8.0.60.0050.00217.01
8.0.50.0050.00316.84
8.0.30.0090.01017.04
8.0.20.0090.01217.40
8.0.10.0030.00516.82
8.0.00.0090.01116.70
7.4.330.0030.00315.00
7.4.320.0050.00316.50
7.4.300.0000.00616.40
7.4.290.0050.00316.61
7.4.280.0050.00516.42
7.4.270.0040.00416.48
7.4.260.0050.00316.52
7.4.250.0000.00716.49
7.4.240.0010.00616.49
7.4.230.0040.00416.52
7.4.220.0080.01216.60
7.4.210.0080.00716.49
7.4.200.0000.00716.49
7.4.190.0040.00416.69
7.4.160.0100.00716.86
7.4.150.0120.00817.40
7.4.140.0100.00917.86
7.4.130.0090.00916.55
7.4.120.0120.00716.57
7.4.110.0060.01116.57
7.4.100.0060.01216.41
7.4.90.0100.00716.53
7.4.80.0150.00419.39
7.4.70.0090.00616.46
7.4.60.0060.01416.54
7.4.50.0000.00816.42
7.4.40.0100.00722.77
7.4.30.0000.01516.27
7.4.10.0040.01414.82
7.4.00.0130.00514.80
7.3.330.0000.00713.25
7.3.320.0030.00313.27
7.3.310.0030.00516.49
7.3.300.0060.00016.40
7.3.290.0100.00716.41
7.3.280.0070.01216.41
7.3.270.0030.01317.40
7.3.260.0100.00616.61
7.3.250.0090.00916.63
7.3.240.0160.00316.61
7.3.230.0110.00616.54
7.3.210.0030.01416.40
7.3.200.0110.00719.39
7.3.190.0070.01316.64
7.3.180.0060.00916.57
7.3.170.0150.00316.34
7.3.160.0160.00016.36
7.3.130.0060.01214.80
7.3.120.0070.00915.10
7.3.110.0090.00914.95
7.3.100.0090.00614.81
7.3.90.0000.01414.66
7.3.80.0060.00914.62
7.3.70.0090.00614.68
7.3.60.0000.01414.81
7.3.50.0110.00314.77
7.3.40.0100.00014.96
7.3.30.0080.00414.70
7.3.20.0120.00416.71
7.3.10.0030.00716.61
7.3.00.0030.01416.73
7.2.330.0140.00416.48
7.2.320.0100.00616.79
7.2.310.0090.00816.64
7.2.300.0100.01416.36
7.2.290.0000.01716.62
7.2.260.0100.01015.17
7.2.250.0030.01414.83
7.2.240.0000.01414.98
7.2.230.0070.01015.22
7.2.220.0040.01215.09
7.2.210.0030.00914.82
7.2.200.0120.00314.93
7.2.190.0030.00615.16
7.2.180.0070.00714.97
7.2.170.0000.00915.05
7.2.160.0040.00815.01
7.2.150.0040.01116.68
7.2.140.0060.00916.64
7.2.130.0030.01016.96
7.2.120.0060.00916.88
7.2.110.0070.00717.01
7.2.100.0030.01616.97
7.2.90.0090.00617.07
7.2.80.0030.01216.75
7.2.70.0060.00616.64
7.2.60.0060.01016.77
7.2.50.0100.00316.97
7.2.40.0070.01016.70
7.2.30.0070.01017.03
7.2.20.0090.00616.86
7.2.10.0030.01316.96
7.2.00.0050.00718.03
7.1.330.0090.00315.82
7.1.320.0000.00915.53
7.1.310.0040.00515.77
7.1.300.0000.00915.77
7.1.290.0040.01115.74
7.1.280.0080.00015.78
7.1.270.0060.00315.78
7.1.260.0030.01215.27
7.1.250.0060.00615.54
7.1.240.0070.00715.70
7.1.230.0060.00615.75
7.1.220.0130.00315.82
7.1.210.0090.00615.81
7.1.200.0030.01015.66
7.1.190.0060.00915.66
7.1.180.0060.00615.69
7.1.170.0090.00315.64
7.1.160.0100.00315.65
7.1.150.0040.00815.41
7.1.140.0080.00415.68
7.1.130.0060.00615.68
7.1.120.0090.00315.59
7.1.110.0030.00615.67
7.1.100.0070.00716.75
7.1.90.0070.01015.86
7.1.80.0030.01415.55
7.1.70.0050.00616.29
7.1.60.0050.01116.35
7.1.50.0020.01016.20
7.1.40.0050.00716.14
7.1.30.0100.00716.12
7.1.20.0040.00716.17
7.1.10.0030.00716.03
7.1.00.0030.00816.15
7.0.330.0100.00315.19
7.0.320.0030.01115.38
7.0.310.0000.01015.41
7.0.300.0060.01015.38
7.0.290.0070.01015.52
7.0.280.0030.00715.23
7.0.270.0030.01415.50
7.0.260.0000.01115.47
7.0.250.0120.00315.10
7.0.240.0070.00715.43
7.0.230.0090.00615.19
7.0.220.0040.00415.33
7.0.210.0000.00915.27
7.0.200.0040.00815.99
7.0.190.0060.00616.00
7.0.180.0050.00516.01
7.0.170.0030.00915.89
7.0.160.0030.00715.83
7.0.150.0030.00815.89
7.0.140.0050.00715.97
7.0.130.0010.00816.01
7.0.120.0010.00815.93
7.0.110.0070.00415.87
7.0.100.0000.00916.02
7.0.90.0030.00615.89
7.0.80.0050.01015.95
7.0.70.0060.00815.93
7.0.60.0020.00715.89
7.0.50.0060.00216.02
7.0.40.0050.00314.85
7.0.30.0040.00714.84
7.0.20.0070.00814.99
7.0.10.0040.01215.03
7.0.00.0060.00714.92
5.6.400.0040.00714.45
5.6.390.0030.01314.06
5.6.380.0040.01414.17
5.6.370.0000.01514.02
5.6.360.0080.00814.16
5.6.350.0100.00314.38
5.6.340.0100.00714.11
5.6.330.0000.01413.79
5.6.320.0080.00414.39
5.6.310.0070.00714.38
5.6.300.0080.02117.29
5.6.290.0050.02917.63
5.6.280.0070.02417.57
5.6.270.0070.02317.63
5.6.260.0030.02617.63
5.6.250.0020.02417.59
5.6.240.0080.02117.60
5.6.230.0030.04817.48
5.6.220.0090.02817.44
5.6.210.0050.02717.70
5.6.200.0030.02717.58
5.6.190.0050.02317.59
5.6.180.0050.02317.47
5.6.170.0040.04317.43
5.6.160.0080.02817.47
5.6.150.0030.02917.32
5.6.140.0150.01717.50
5.6.130.0040.02417.72
5.6.120.0020.02917.49
5.6.110.0030.02417.52
5.6.100.0070.02117.63
5.6.90.0060.02417.61
5.6.80.0070.02317.05
5.6.70.0050.02417.33
5.6.60.0030.02717.26
5.6.50.0030.02417.15
5.6.40.0190.02417.29
5.6.30.0050.02617.19
5.6.20.0030.02717.20
5.6.10.0070.02217.11
5.6.00.0080.02217.05
5.5.380.0100.02415.75
5.5.370.0060.02115.67
5.5.360.0020.02915.87
5.5.350.0070.02715.93
5.5.340.0020.02816.05
5.5.330.0040.02516.12
5.5.320.0050.02416.12
5.5.310.0080.04615.98
5.5.300.0070.02415.96
5.5.290.0080.02215.98
5.5.280.0030.02616.07
5.5.270.0050.02215.86
5.5.260.0050.02316.00
5.5.250.0030.03015.78
5.5.240.0040.02815.73
5.5.230.0050.02415.74
5.5.220.0030.02615.64
5.5.210.0050.02015.64
5.5.200.0040.02415.79
5.5.190.0050.02315.76
5.5.180.0020.02615.79
5.5.170.0070.00713.85
5.5.160.0050.02215.61
5.5.150.0020.02715.40
5.5.140.0050.02415.59
5.5.130.0050.02615.43
5.5.120.0060.02115.60
5.5.110.0040.02115.49
5.5.100.0020.02415.39
5.5.90.0050.02315.64
5.5.80.0090.02115.55
5.5.70.0070.02515.71
5.5.60.0070.02915.64
5.5.50.0000.02715.46
5.5.40.0020.02415.63
5.5.30.0050.02415.72
5.5.20.0040.02615.51
5.5.10.0080.01815.62
5.5.00.0030.02615.41
5.4.450.0050.02416.16
5.4.440.0030.02616.15
5.4.430.0030.02216.29
5.4.420.0030.02516.25
5.4.410.0040.02416.20
5.4.400.0020.02615.99
5.4.390.0070.02116.11
5.4.380.0000.02816.08
5.4.370.0080.02416.08
5.4.360.0110.01616.13
5.4.350.0050.02116.10
5.4.340.0030.02316.07
5.4.330.0060.00313.13
5.4.320.0000.02616.05
5.4.310.0040.02515.97
5.4.300.0060.02516.09
5.4.290.0130.02216.13
5.4.280.0050.02716.13
5.4.270.0050.02416.08
5.4.260.0030.02015.99
5.4.250.0020.02516.08
5.4.240.0070.02116.14
5.4.230.0020.02516.09
5.4.220.0030.02416.13
5.4.210.0020.02616.04
5.4.200.0040.02216.04
5.4.190.0110.02715.99
5.4.180.0010.02815.98
5.4.170.0060.03416.08
5.4.160.0060.02516.09
5.4.150.0030.02515.98
5.4.140.0030.02314.84
5.4.130.0060.01914.84
5.4.120.0060.02014.84
5.4.110.0050.02214.84
5.4.100.0030.02414.84
5.4.90.0060.01914.84
5.4.80.0020.02414.84
5.4.70.0050.01814.84
5.4.60.0050.02114.83
5.4.50.0060.02214.73
5.4.40.0060.02114.90
5.4.30.0050.02014.85
5.4.20.0030.02014.88
5.4.10.0110.02614.89
5.4.00.0020.02314.58
5.3.290.0050.02214.84
5.3.280.0100.01914.84
5.3.270.0040.02214.84
5.3.260.0030.02314.84
5.3.250.0120.01714.84
5.3.240.0020.02514.84
5.3.230.0020.02514.84
5.3.220.0070.02214.84
5.3.210.0050.02014.84
5.3.200.0030.02114.84
5.3.190.0020.02514.84
5.3.180.0060.01914.84
5.3.170.0020.02514.84
5.3.160.0030.02314.14
5.3.150.0050.02214.14
5.3.140.0040.02914.14
5.3.130.0020.02814.14
5.3.120.0000.02914.14
5.3.110.0030.02414.14
5.3.100.0030.03314.14
5.3.90.0070.03514.14
5.3.80.0050.02014.14
5.3.70.0040.02414.14
5.3.60.0030.04014.14
5.3.50.0000.03114.14
5.3.40.0030.03314.14
5.3.30.0040.02114.14
5.3.20.0040.02114.14
5.3.10.0040.02314.14
5.3.00.0030.02514.14
5.2.170.0030.04915.15
5.2.160.0090.02515.15
5.2.150.0030.02915.15
5.2.140.0000.03215.15
5.2.130.0000.03215.15
5.2.120.0000.06715.15
5.2.110.0000.03915.15
5.2.100.0030.03015.15
5.2.90.0000.03815.15
5.2.80.0030.03015.15
5.2.70.0000.04115.15
5.2.60.0030.03215.22
5.2.50.0040.02915.29
5.2.40.0000.03315.29
5.2.30.0100.05815.29
5.2.20.0000.03315.29
5.2.10.0000.03015.50
5.2.00.0060.05515.50
5.1.60.0000.03015.50
5.1.50.0030.02315.50
5.1.40.0030.02315.64
5.1.30.0030.03615.64
5.1.20.0090.02815.64
5.1.10.0030.02715.71
5.1.00.0000.04715.71
5.0.50.0090.01815.84
5.0.40.0060.01715.91
5.0.30.0000.03415.98
5.0.20.0030.02116.05
5.0.10.0040.01816.12
5.0.00.0040.03016.12
4.4.90.0070.01415.15
4.4.80.0040.01515.22
4.4.70.0030.01515.29
4.4.60.0000.01815.36
4.4.50.0000.02215.43
4.4.40.0000.03115.50
4.4.30.0030.01515.57
4.4.20.0030.02915.64
4.4.10.0000.02215.71
4.4.00.0040.03215.84
4.3.110.0000.02015.91
4.3.100.0000.01815.98
4.3.90.0030.01616.05
4.3.80.0070.02316.12
4.3.70.0040.01416.19
4.3.60.0040.01516.26
4.3.50.0060.02516.26
4.3.40.0030.02316.26
4.3.30.0040.01516.26
4.3.20.0070.01816.26
4.3.10.0030.01716.26
4.3.00.0000.03016.26

preferences:
51.1 ms | 400 KiB | 5 Q