3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class WorkUnitDataType { const NoneType = 0; const ArrayType = 1; const JsonType = 2; const UrlType = 3; const FileType = 4; private $value; private $name; protected function __construct($input) { if (is_int($input)) { $this->setByValue($input); } else if (is_string($input)) { $this->setByName($input); } } protected function setByValue($value) { if (is_int($value)) { $this->value = $value; $this->name = WorkUnitDataType::toString($value); } } protected function setByName($name) { if (is_) $this->value = WorkUnitDataType::toString($name); $this->name = $name; } public static function toString($const) { $class = new ReflectionClass('WorkUnitDataType'); $constants = $class->getConstants(); foreach ($constants as $name => $value) { if ($value == $const) { return $name; } } return Null; } public static function toValue($text) { $class = new ReflectionClass('WorkUnitDataType'); $constants = $class->getConstants(); foreach ($constants as $name => $value) { if ($name == $text) { return $value; } } return -1; } } class NoneType extends WorkUnitDataType { public function __construct() { parent::__construct(get_class($this)); } } $a = new NoneType(); var_dump($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)
8.3.70.0090.00616.88
8.3.60.0060.00916.38
8.3.50.0150.00321.02
8.3.40.0070.01418.86
8.3.30.0110.00318.70
8.3.20.0030.00520.16
8.3.10.0050.00321.91
8.3.00.0050.00223.48
8.2.190.0080.00816.75
8.2.180.0000.01418.17
8.2.170.0100.00722.96
8.2.160.0070.00720.37
8.2.150.0030.00524.18
8.2.140.0050.00324.66
8.2.130.0050.00319.64
8.2.120.0050.00326.35
8.2.110.0030.00721.06
8.2.100.0050.00518.03
8.2.90.0000.00819.13
8.2.80.0000.00917.97
8.2.70.0060.00317.63
8.2.60.0000.00817.93
8.2.50.0000.00818.07
8.2.40.0030.00720.30
8.2.30.0050.00219.29
8.2.20.0080.00017.78
8.2.10.0040.00418.06
8.2.00.0070.00018.09
8.1.280.0080.01125.92
8.1.270.0180.00023.96
8.1.260.0080.00028.09
8.1.250.0040.00428.09
8.1.240.0030.00622.53
8.1.230.0120.00019.10
8.1.220.0040.00417.74
8.1.210.0030.00718.77
8.1.200.0060.00317.23
8.1.190.0050.00317.10
8.1.180.0030.00518.10
8.1.170.0090.00018.55
8.1.160.0040.00420.70
8.1.150.0040.00418.74
8.1.140.0030.00619.52
8.1.130.0000.00717.58
8.1.120.0000.00717.45
8.1.110.0030.00517.36
8.1.100.0030.00617.40
8.1.90.0000.00817.39
8.1.80.0090.00017.43
8.1.70.0030.00317.44
8.1.60.0030.00517.49
8.1.50.0000.00917.52
8.1.40.0040.00417.48
8.1.30.0000.00817.63
8.1.20.0040.00417.48
8.1.10.0040.00417.57
8.1.00.0000.00917.55
8.0.300.0000.00718.77
8.0.290.0040.00416.88
8.0.280.0000.00818.53
8.0.270.0000.00717.29
8.0.260.0030.00317.30
8.0.250.0000.00717.12
8.0.240.0000.00816.96
8.0.230.0080.00016.96
8.0.220.0040.00416.96
8.0.210.0000.00716.97
8.0.200.0030.00316.94
8.0.190.0040.00417.09
8.0.180.0060.00317.04
8.0.170.0040.00417.04
8.0.160.0040.00416.96
8.0.150.0050.00316.98
8.0.140.0000.00817.00
8.0.130.0000.00513.45
8.0.120.0030.00616.98
8.0.110.0050.00216.89
8.0.100.0060.00317.01
8.0.90.0000.00817.01
8.0.80.0060.00916.95
8.0.70.0080.00016.88
8.0.60.0040.00416.97
8.0.50.0070.00017.03
8.0.30.0110.00617.16
8.0.20.0100.00917.40
8.0.10.0040.00416.92
8.0.00.0100.00916.81
7.4.330.0000.00516.71
7.4.320.0030.00316.56
7.4.300.0040.00416.68
7.4.290.0070.00016.52
7.4.280.0040.00716.62
7.4.270.0000.00716.61
7.4.260.0000.00716.66
7.4.250.0070.00016.52
7.4.240.0020.00516.59
7.4.230.0070.00016.47
7.4.220.0180.01116.73
7.4.210.0060.00916.55
7.4.200.0030.00616.56
7.4.160.0080.00816.54
7.4.150.0140.00617.40
7.4.140.0120.01217.86
7.4.130.0090.01216.58
7.4.120.0050.01316.70
7.4.110.0040.01416.58
7.4.100.0090.00916.79
7.4.90.0110.00716.53
7.4.80.0130.01019.39
7.4.70.0000.02116.65
7.4.60.0130.00616.61
7.4.50.0120.00316.59
7.4.40.0090.00916.55
7.4.30.0110.01016.68
7.4.00.0060.00914.94
7.3.330.0000.00613.39
7.3.320.0000.00613.22
7.3.310.0030.00616.29
7.3.300.0000.00716.43
7.3.290.0070.00816.38
7.3.280.0080.00816.35
7.3.270.0130.00617.40
7.3.260.0110.00716.54
7.3.250.0130.00716.48
7.3.240.0110.00816.53
7.3.230.0090.01216.39
7.3.210.0090.01316.67
7.3.200.0090.01219.39
7.3.190.0000.01816.56
7.3.180.0100.00716.55
7.3.170.0100.01116.46
7.3.160.0060.01116.63
7.2.330.0100.01116.75
7.2.320.0040.01316.53
7.2.310.0060.01016.63
7.2.300.0110.01216.81
7.2.290.0040.01216.83
7.2.60.0060.00916.75
7.2.00.0030.00919.50
7.1.200.0040.00915.77
7.1.100.0040.00818.18
7.1.70.0000.01016.66
7.1.60.0130.01019.18
7.1.50.0130.01016.89
7.1.00.0000.08022.44
7.0.200.0320.00316.68
7.0.60.0130.07321.82
7.0.50.0070.08017.93
7.0.40.0100.08020.11
7.0.30.0330.03720.10
7.0.20.0300.07720.16
7.0.10.0070.06320.21
7.0.00.0070.08720.07
5.6.280.0000.05320.80
5.6.210.0130.07720.49
5.6.200.0030.08318.14
5.6.190.0170.08020.68
5.6.180.0600.05020.61
5.6.170.0330.07320.44
5.6.160.0070.07020.54
5.6.150.0070.08018.19
5.6.140.0130.07718.24
5.6.130.0000.04318.27
5.6.120.0070.05721.03
5.6.110.0030.04321.02
5.6.100.0170.06321.04
5.6.90.0270.06721.14
5.6.80.0100.07720.54
5.5.350.0270.05720.51
5.5.340.0030.04017.98
5.5.330.0100.08020.57
5.5.320.0270.05320.51
5.5.310.0270.06320.36
5.5.300.0030.08717.98
5.5.290.0030.04018.07
5.5.280.0030.08320.67
5.5.270.0070.09020.77
5.5.260.0070.06320.77
5.5.250.0030.08020.68
5.5.240.0070.07020.27

preferences:
73.42 ms | 401 KiB | 5 Q