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.0210.00316.88
8.3.50.0220.00721.19
8.3.40.0070.01518.76
8.3.30.0110.01118.95
8.3.20.0100.00020.25
8.3.10.0030.00723.59
8.3.00.0070.00419.13
8.2.180.0100.01018.29
8.2.170.0070.01522.96
8.2.160.0180.00418.78
8.2.150.0110.00024.18
8.2.140.0040.00724.66
8.2.130.0190.00426.16
8.2.120.0080.00322.13
8.2.110.0030.01019.45
8.2.100.0150.00017.65
8.2.90.0000.00919.07
8.2.80.0090.00017.97
8.2.70.0030.00717.50
8.2.60.0040.00817.93
8.2.50.0090.00018.07
8.2.40.0000.01118.22
8.2.30.0060.00318.05
8.2.20.0030.00617.61
8.2.10.0000.00918.00
8.2.00.0040.01217.69
8.1.280.0120.00925.92
8.1.270.0080.00423.91
8.1.260.0100.00026.35
8.1.250.0040.00828.09
8.1.240.0100.00321.42
8.1.230.0040.01117.52
8.1.220.0060.00317.77
8.1.210.0030.00618.77
8.1.200.0110.00017.13
8.1.190.0030.00617.36
8.1.180.0000.00918.10
8.1.170.0100.00018.71
8.1.160.0030.00622.00
8.1.150.0000.00918.74
8.1.140.0030.00717.50
8.1.130.0040.00417.93
8.1.120.0050.00517.46
8.1.110.0000.00917.50
8.1.100.0060.00317.54
8.1.90.0060.00317.39
8.1.80.0030.00617.39
8.1.70.0030.00617.48
8.1.60.0080.00317.66
8.1.50.0000.00917.62
8.1.40.0110.00017.51
8.1.30.0060.00317.57
8.1.20.0070.00317.70
8.1.10.0090.00017.59
8.1.00.0050.00517.51
8.0.300.0040.00418.77
8.0.290.0030.00716.63
8.0.280.0040.00418.49
8.0.270.0000.00917.29
8.0.260.0000.00817.18
8.0.250.0000.00817.11
8.0.240.0060.00317.02
8.0.230.0040.00417.08
8.0.220.0000.00816.99
8.0.210.0040.00416.93
8.0.200.0030.00616.92
8.0.190.0030.00717.13
8.0.180.0060.00317.08
8.0.170.0030.00717.00
8.0.160.0040.00416.98
8.0.150.0030.00616.95
8.0.140.0000.00916.98
8.0.130.0040.00413.39
8.0.120.0030.00717.07
8.0.110.0040.00416.85
8.0.100.0040.00416.99
8.0.90.0030.00616.88
8.0.80.0100.02016.96
8.0.70.0090.00017.12
8.0.60.0030.00616.82
8.0.50.0060.00316.85
8.0.30.0250.00917.12
8.0.20.0240.00817.40
8.0.10.0000.01017.23
8.0.00.0200.01916.80
7.4.330.0050.00215.00
7.4.320.0030.00616.53
7.4.300.0040.00416.54
7.4.290.0080.00016.57
7.4.280.0100.00316.62
7.4.270.0100.00016.67
7.4.260.0000.00916.64
7.4.250.0030.00616.61
7.4.240.0080.00216.64
7.4.230.0030.00616.62
7.4.220.0090.01916.66
7.4.210.0100.01316.60
7.4.200.0090.00016.49
7.4.190.0070.00316.56
7.4.160.0100.02016.38
7.4.150.0120.02117.40
7.4.140.0170.01617.86
7.4.130.0160.01916.43
7.4.120.0180.01316.70
7.4.110.0120.01916.40
7.4.100.0220.00916.68
7.4.90.0190.01116.45
7.4.80.0110.02619.39
7.4.70.0090.01816.58
7.4.60.0190.00916.46
7.4.50.0040.00816.28
7.4.40.0030.01622.77
7.4.30.0190.00716.36
7.4.00.0120.00914.84
7.3.330.0060.00313.23
7.3.320.0040.00413.13
7.3.310.0090.00316.24
7.3.300.0030.00616.31
7.3.290.0090.01216.34
7.3.280.0120.01316.32
7.3.270.0220.01617.40
7.3.260.0250.00316.72
7.3.250.0280.01216.56
7.3.240.0290.00816.40
7.3.230.0200.01016.46
7.3.210.0200.01016.57
7.3.200.0180.01519.39
7.3.190.0090.01816.34
7.3.180.0070.01916.36
7.3.170.0150.01716.36
7.3.160.0130.01316.65
7.3.120.0040.01814.83
7.3.10.0220.00616.42
7.3.00.0250.00716.16
7.2.330.0240.00816.59
7.2.320.0120.01916.70
7.2.310.0160.01216.68
7.2.300.0150.01216.38
7.2.290.0180.00916.31
7.2.130.0180.00916.66
7.2.120.0100.00716.41
7.2.110.0130.01016.43
7.2.100.0180.00716.58
7.2.90.0160.00316.52
7.2.80.0160.01016.45
7.2.70.0190.00016.65
7.2.60.0160.01016.44
7.2.50.0170.00616.54
7.2.40.0140.00316.21
7.2.30.0170.00316.26
7.2.20.0190.01016.04
7.2.10.0170.00716.41
7.2.00.0130.01016.55
7.1.250.0030.01715.17
7.1.200.0400.00015.63
7.1.100.0120.00418.14
7.1.70.0000.00816.70
7.1.60.0130.01719.33
7.1.50.0120.01516.57
7.1.00.0000.08322.45
7.0.200.0210.00714.67
7.0.140.0130.07022.09
7.0.60.0130.08019.87
7.0.50.0130.04017.92
7.0.40.0030.04320.30
7.0.30.0400.04320.33
7.0.20.0300.05320.01
7.0.10.0130.08720.09
7.0.00.0130.08020.30
5.6.280.0130.07020.93
5.6.210.0130.03320.54
5.6.200.0170.08018.12
5.6.190.0030.09320.45
5.6.180.0270.04320.67
5.6.170.0330.07320.71
5.6.160.0100.03720.71
5.6.150.0030.08318.22
5.6.140.0130.08018.10
5.6.130.0170.07318.21
5.6.120.0030.08321.01
5.6.110.0070.07721.01
5.6.100.0230.07021.12
5.6.90.0170.07721.03
5.6.80.0130.08320.42
5.6.70.4800.05020.40
5.5.350.0230.07720.36
5.5.340.0130.07717.95
5.5.330.0130.08320.14
5.5.320.0000.04320.39
5.5.310.0330.08020.31
5.5.300.0100.06317.96
5.5.290.0030.04717.92
5.5.280.0070.06720.90
5.5.270.0000.05720.90
5.5.260.0130.07020.76
5.5.250.0070.08020.61
5.5.240.0200.07720.21
5.4.450.0470.06319.63
5.4.440.0830.06319.58
5.4.430.1000.04719.29
5.4.420.0130.06319.57
5.4.410.0970.06319.19
5.4.400.0930.06719.30
5.4.390.1070.06318.92
5.4.380.0270.06318.80
5.4.370.0200.06018.63
5.4.360.0370.05318.62
5.4.350.0400.05318.72
5.4.340.0470.06318.69
5.4.320.0120.03612.63
5.4.310.0120.04312.62
5.4.300.0110.03812.63
5.4.290.0070.05012.62
5.4.280.0220.09612.49
5.4.270.0110.05212.49
5.4.260.0200.11512.49
5.4.250.0110.06312.49
5.4.240.0320.11612.49
5.4.230.0180.05812.48
5.4.220.0130.05312.48
5.4.210.0240.07112.48
5.4.200.0180.11312.48
5.4.190.0080.05912.48
5.4.180.0140.05812.48
5.4.170.0190.05312.49
5.4.160.0170.05412.48
5.4.150.0390.12712.48
5.4.140.0180.07112.16
5.4.130.0100.05412.16
5.4.120.0170.05812.11
5.4.110.0170.05512.11
5.4.100.0300.07312.11
5.4.90.0110.05812.11
5.4.80.0200.04812.11
5.4.70.0200.04812.11
5.4.60.0120.06012.11
5.4.50.0120.05912.10
5.4.40.0150.04512.09
5.4.30.0120.06412.09
5.4.20.0080.04012.09
5.4.10.0160.04412.09
5.4.00.0140.04011.59
5.3.290.0150.04812.88
5.3.280.0190.04512.79
5.3.270.0100.05612.80
5.3.260.0260.05712.80
5.3.250.0320.13712.80
5.3.240.0210.06412.79
5.3.230.0210.05412.79
5.3.220.0210.06012.76
5.3.210.0160.06412.76
5.3.200.0400.09512.76
5.3.190.0170.08512.76
5.3.180.0130.05612.75
5.3.170.0220.04612.76
5.3.160.0140.05912.75
5.3.150.0300.09812.75
5.3.140.0150.05412.75
5.3.130.0150.08312.74
5.3.120.0230.08012.74
5.3.110.0120.04112.74
5.3.100.0130.04112.25
5.3.90.0180.05812.21
5.3.80.0140.05212.20
5.3.70.0250.07312.19
5.3.60.0160.05212.18
5.3.50.0150.04012.13
5.3.40.0140.05712.13
5.3.30.0140.06412.09
5.3.20.0160.05411.87
5.3.10.0200.07611.83
5.3.00.0200.04211.82
5.2.170.0130.0819.16
5.2.160.0130.0599.15
5.2.150.0120.0419.15
5.2.140.0060.0349.15
5.2.130.0160.0579.11
5.2.120.0060.0399.11
5.2.110.0140.0599.11
5.2.100.0460.1049.12
5.2.90.0110.0359.11
5.2.80.0070.0519.11
5.2.70.0140.0669.11
5.2.60.0180.0559.06
5.2.50.0190.0689.04
5.2.40.0070.0469.00
5.2.30.0130.0588.98
5.2.20.0300.0478.97
5.2.10.0050.0448.90
5.2.00.0060.0308.76
5.1.60.0050.0278.05
5.1.50.0050.0408.04
5.1.40.0080.0268.03
5.1.30.0070.0288.37
5.1.20.0060.0318.40
5.1.10.0070.0348.13
5.1.00.0080.0338.13
5.0.50.0120.0346.60
5.0.40.0170.0236.46
5.0.30.0180.0666.27
5.0.20.0060.0306.25
5.0.10.0050.0276.22
5.0.00.0090.0616.21
4.4.90.0100.0224.78
4.4.80.0070.0384.75
4.4.70.0060.0204.75
4.4.60.0090.0224.75
4.4.50.0100.0344.77
4.4.40.0070.0424.70
4.4.30.0050.0244.76
4.4.20.0210.0904.85
4.4.10.0140.0314.85
4.4.00.0080.0484.76
4.3.110.0160.0494.67
4.3.100.0130.0334.66
4.3.90.0050.0154.63
4.3.80.0060.0314.59
4.3.70.0000.0224.63
4.3.60.0030.0224.63
4.3.50.0060.0164.62
4.3.40.0090.0574.54
4.3.30.0050.0323.27
4.3.20.0190.0253.25
4.3.10.0030.0153.22
4.3.00.0030.01710.37

preferences:
42.44 ms | 400 KiB | 5 Q