3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface ConfigValueInterface { public function __toString(); } interface ConfigWriterInterface { public function write(ConfigValueInterface $value); } class WriteManager { protected $writers = []; public function addWriter(ConfigWriterInterface $writer, $value_class) { $this->writers[$value_class] = $writer; } public function write(ConfigValueInterface $value) { $class = get_class($value); if (isset($this->writers[$class])) { $this->writers[$class]->write($value); } } } class BaseConfigValue implements ConfigValueInterface { public $storage_location; } class BaseConfigWriter implements ConfigWriterInterface { public function write(BaseConfigValue $value) { echo "writing to {$value->storage_location}"; } } // Set up manager $manager = new WriteManager(); $manager->addWriter(new BaseConfigWriter, BaseConfigValue::class); // $value = $generator->generate(); $manager->write($value);

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.0190.00016.75
8.3.50.0150.00521.97
8.3.40.0110.00418.59
8.3.30.0160.00618.57
8.3.20.0000.00720.16
8.3.10.0050.00323.48
8.3.00.0080.00019.79
8.2.180.0120.00318.29
8.2.170.0090.00622.96
8.2.160.0070.00720.34
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0090.00021.05
8.2.120.0040.00426.35
8.2.110.0090.00020.52
8.2.100.0000.01217.90
8.2.90.0060.00319.09
8.2.80.0080.00017.97
8.2.70.0030.00617.61
8.2.60.0060.00317.90
8.2.50.0000.00818.07
8.2.40.0080.00022.30
8.2.30.0070.00020.70
8.2.20.0000.00817.62
8.2.10.0030.00518.07
8.2.00.0050.00317.88
8.1.280.0090.01525.92
8.1.270.0120.00620.06
8.1.260.0040.01528.09
8.1.250.0050.00328.09
8.1.240.0030.00722.25
8.1.230.0040.00817.66
8.1.220.0000.00817.74
8.1.210.0060.00318.77
8.1.200.0030.00617.23
8.1.190.0040.00416.86
8.1.180.0040.00418.10
8.1.170.0040.00418.52
8.1.160.0080.00020.71
8.1.150.0040.00418.84
8.1.140.0000.00819.52
8.1.130.0040.00417.71
8.1.120.0070.00017.40
8.1.110.0040.00417.43
8.1.100.0060.00317.29
8.1.90.0000.00817.29
8.1.80.0000.00717.35
8.1.70.0070.00017.40
8.1.60.0060.00317.48
8.1.50.0030.00617.43
8.1.40.0000.00817.37
8.1.30.0050.00317.54
8.1.20.0050.00317.50
8.1.10.0000.00717.27
8.1.00.0030.00517.35
8.0.300.0000.00718.77
8.0.290.0070.00016.75
8.0.280.0030.00318.37
8.0.270.0040.00417.27
8.0.260.0060.00017.25
8.0.250.0000.00616.85
8.0.240.0030.00317.00
8.0.230.0040.00416.98
8.0.220.0040.00416.77
8.0.210.0000.00716.77
8.0.200.0000.00716.90
8.0.190.0070.00016.87
8.0.180.0040.00416.93
8.0.170.0060.00616.85
8.0.160.0040.00416.92
8.0.150.0040.00416.79
8.0.140.0050.00216.91
8.0.130.0030.00313.37
8.0.120.0000.01016.77
8.0.110.0000.00716.73
8.0.100.0040.00417.02
8.0.90.0040.00416.78
8.0.80.0100.00616.79
8.0.70.0030.00516.86
8.0.60.0050.00216.78
8.0.50.0000.00716.86
8.0.30.0100.01016.96
8.0.20.0070.01217.40
8.0.10.0000.00717.01
8.0.00.0050.01316.68
7.4.330.0000.00516.71
7.4.320.0030.00316.46
7.4.300.0030.00316.50
7.4.290.0070.00016.59
7.4.280.0040.00416.59
7.4.270.0000.00716.41
7.4.260.0030.00616.59
7.4.250.0000.00716.39
7.4.240.0020.00516.55
7.4.230.0000.00716.55
7.4.220.0180.00916.58
7.4.210.0070.00716.55
7.4.200.0030.00516.25
7.4.160.0140.00316.44
7.4.150.0110.00717.40
7.4.140.0110.01117.86
7.4.130.0110.00616.49
7.4.120.0090.01016.39
7.4.110.0070.01016.65
7.4.100.0100.01316.58
7.4.90.0070.01016.56
7.4.80.0100.01019.39
7.4.70.0110.00716.38
7.4.60.0120.00916.36
7.4.50.0060.01016.32
7.4.40.0000.01616.45
7.4.30.0080.00816.60
7.4.10.0040.01114.77
7.4.00.0080.00715.08
7.3.330.0000.00713.11
7.3.320.0050.00013.07
7.3.310.0000.00716.27
7.3.300.0030.00316.25
7.3.290.0070.00916.25
7.3.280.0070.01116.25
7.3.270.0080.00817.40
7.3.260.0150.00316.43
7.3.250.0150.00516.30
7.3.240.0050.01416.43
7.3.230.0090.00916.39
7.3.210.0090.00916.40
7.3.200.0030.01216.17
7.3.190.0060.01016.45
7.3.180.0150.00616.41
7.3.170.0200.00316.27
7.3.160.0120.00916.24
7.3.130.0000.01914.72
7.3.120.0060.00914.86
7.3.110.0090.00914.84
7.3.100.0060.00914.68
7.3.90.0090.00014.69
7.3.80.0100.00714.50
7.3.70.0060.00614.54
7.3.60.0030.01114.92
7.3.50.0000.01014.58
7.3.40.0050.00914.79
7.3.30.0040.00414.75
7.3.20.0060.00616.71
7.3.10.0090.00616.59
7.3.00.0000.01416.68
7.2.330.0110.00716.45
7.2.320.0070.01116.34
7.2.310.0170.00716.61
7.2.300.0110.00516.67
7.2.290.0090.00916.38
7.2.260.0040.01114.67
7.2.250.0110.00715.13
7.2.240.0100.00315.09
7.2.230.0090.00614.73
7.2.220.0000.01414.82
7.2.210.0030.01414.75
7.2.200.0030.01214.77
7.2.190.0100.00314.87
7.2.180.0030.00615.00
7.2.170.0100.00314.81
7.2.160.0030.01614.60
7.2.150.0070.00316.98
7.2.140.0070.01016.61
7.2.130.0100.00716.73
7.2.120.0040.00816.58
7.2.110.0080.00416.46
7.2.100.0070.00716.82
7.2.90.0000.01416.70
7.2.80.0080.00816.80
7.2.70.0120.00616.66
7.2.60.0090.00516.69
7.2.50.0040.00816.91
7.2.40.0090.00616.66
7.2.30.0070.00716.82
7.2.20.0110.00316.77
7.2.10.0030.01016.54
7.2.00.0050.00818.16
7.1.330.0040.01115.53
7.1.320.0030.00615.60
7.1.310.0040.01015.80
7.1.300.0030.01315.51
7.1.290.0030.00715.71
7.1.280.0040.00415.69
7.1.270.0030.01015.83
7.1.260.0030.01015.68
7.1.250.0030.00715.59
7.1.240.0030.00815.68
7.1.230.0110.00415.54
7.1.220.0080.00415.52
7.1.210.0030.01015.53
7.1.200.0070.00715.68
7.1.190.0090.00915.40
7.1.180.0070.00415.77
7.1.170.0110.00315.72
7.1.160.0000.01315.61
7.1.150.0100.00015.58
7.1.140.0090.00615.77
7.1.130.0060.00915.68
7.1.120.0090.00615.81
7.1.110.0060.00315.84
7.1.100.0070.00715.73
7.1.90.0030.00715.66
7.1.80.0030.00915.53
7.1.70.0030.00716.40
7.1.60.0030.01016.48
7.1.50.0050.00716.25
7.1.40.0030.00915.58
7.1.30.0080.00415.73
7.1.20.0070.00715.77
7.1.10.0100.00315.70
7.1.00.0000.04418.82
7.0.330.0040.00715.39
7.0.320.0040.00815.12
7.0.310.0100.00714.96
7.0.300.0000.01615.41
7.0.290.0100.00715.50
7.0.280.0000.00915.32
7.0.270.0070.00615.41
7.0.260.0000.01215.07
7.0.250.0130.00015.22
7.0.240.0040.01115.29
7.0.230.0030.01015.33
7.0.220.0030.01015.48
7.0.210.0060.00615.32
7.0.200.0030.00816.09
7.0.190.0070.00715.36
7.0.180.0000.00815.47
7.0.170.0030.00615.46
7.0.160.0000.01115.51
7.0.150.0060.00815.36
7.0.140.0110.00015.18
7.0.130.0070.00715.41
7.0.120.0080.00615.25
7.0.110.0000.01015.06
7.0.100.0100.00615.42
7.0.90.0030.01015.23
7.0.80.0000.01615.54
7.0.70.0080.00415.15
7.0.60.0210.02517.64
7.0.50.0140.02916.59
7.0.40.0050.04916.50
7.0.30.0120.02716.56
7.0.20.0240.03616.69
7.0.10.0080.04616.74
7.0.00.0050.04416.60
5.6.400.0060.00614.34
5.6.390.0140.00013.89
5.6.380.0100.00314.16
5.6.370.0070.01014.11
5.6.360.0030.01014.45
5.6.350.0070.01014.07
5.6.340.0030.01014.36
5.6.330.0080.00413.94
5.6.320.0100.00014.48
5.6.310.0030.01013.93
5.6.300.0110.00314.39
5.6.290.0040.00713.91
5.6.280.0050.04017.52
5.6.270.0000.01614.28
5.6.260.0070.00714.41
5.6.250.0000.00914.36
5.6.240.0070.00714.23
5.6.230.0040.01114.24
5.6.220.0040.01114.15
5.6.210.0050.03817.29
5.6.200.0080.04116.18
5.6.190.0030.04417.40
5.6.180.0120.04417.40
5.6.170.0260.03617.38
5.6.160.0080.04317.18
5.6.150.0050.04516.17
5.6.140.0100.02316.10
5.6.130.0060.03616.25
5.6.120.0030.03317.51
5.6.110.0090.02217.45
5.6.100.0010.02817.66
5.6.90.0080.04717.52
5.6.80.0100.04217.07
5.6.70.0040.01114.29
5.6.60.0060.00914.04
5.6.50.0060.01213.69
5.6.40.0040.01114.14
5.6.30.0030.00914.14
5.6.20.0060.00614.07
5.6.10.0030.00913.88
5.6.00.0040.00814.36
5.5.380.0120.00314.23
5.5.370.0080.00814.07
5.5.360.0000.01414.01
5.5.350.0060.02117.23
5.5.340.0060.02715.95
5.5.330.0100.03717.07
5.5.320.0120.03716.99
5.5.310.0110.03017.17
5.5.300.0070.02315.98
5.5.290.0060.04316.08
5.5.280.0100.04317.34
5.5.270.0100.04317.34
5.5.260.0080.04117.26
5.5.250.0060.02517.42
5.5.240.0050.03517.21
5.5.230.0030.00614.15
5.5.220.0100.00013.75
5.5.210.0040.01113.96
5.5.200.0090.00014.13
5.5.190.0040.01214.14
5.5.180.0070.00714.04
5.5.170.0070.00714.04
5.5.160.0000.01214.02
5.5.150.0110.00414.08
5.5.140.0080.00414.15
5.5.130.0040.00813.94
5.5.120.0090.00013.89
5.5.110.0000.01314.22
5.5.100.0030.01013.91
5.5.90.0030.00713.80
5.5.80.0030.00614.01
5.5.70.0080.00413.96
5.5.60.0060.00914.11
5.5.50.0120.00314.11
5.5.40.0040.01113.99
5.5.30.0070.00714.08
5.5.20.0030.00613.77
5.5.10.0000.00914.00
5.5.00.0000.00914.18

preferences:
46.15 ms | 401 KiB | 5 Q