3v4l.org

run code in 300+ PHP versions simultaneously
<?php final class CommandId { private $name; private $time; private $hash; public function __construct($name) { $this->time = microtime(true); $this->name = trim($name); $this->hash = hash('crc32', (string) $this->time); if (empty($this->name)) { throw new DomainException('Name must not be empty'); } } public static function fromString($idString) { $parts = explode('_', $idString); if (count($parts) != 3) { throw new DomainException("Unexpected format [$idString]"); } $id = new static($parts[0]); $id->time = (float) $parts[1]; $id->hash = $parts[2]; return $id; } public function name() { return $this->name; } public function time() { return $this->time; } public function __toString() { return "{$this->name}_{$this->time}_{$this->hash}"; } } $one = new CommandId('foo'); $two = new CommandId('foo'); assert($one != $two); var_dump($one, $two, (string) $one, (string) $two);

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)
7.2.00.0030.01219.33
7.1.70.0040.00416.86
7.1.60.0030.01019.43
7.1.50.0070.01416.80
7.1.00.0000.04722.33
7.0.200.0130.00616.57
7.0.140.0030.07721.93
7.0.60.0030.08319.89
7.0.50.0030.06017.97
7.0.40.0100.06020.20
7.0.30.0330.07720.35
7.0.20.0200.04320.23
7.0.10.0400.07020.16
7.0.00.0030.09320.05
5.6.280.0000.07721.07
5.6.210.0070.06720.76
5.6.200.0070.04018.25
5.6.190.0000.05020.47
5.6.180.0230.03720.48
5.6.170.0400.04020.39
5.6.160.0100.08320.46
5.6.150.0070.07018.25
5.6.140.0100.04718.19
5.6.130.0000.08718.18
5.6.120.0030.04321.00
5.6.110.0070.04021.02
5.6.100.0070.03721.12
5.6.90.0030.08720.98
5.6.80.0100.07320.54
5.6.70.0300.07720.38
5.5.350.0100.04020.34
5.5.340.0130.04318.05
5.5.330.0130.07720.27
5.5.320.0230.04320.34
5.5.310.0270.07320.26
5.5.300.0000.04717.93
5.5.290.0030.05718.04
5.5.280.0200.07020.91
5.5.270.0070.04320.88
5.5.260.0070.04020.99
5.5.250.0130.07320.63
5.5.240.0070.07720.17
5.4.450.2500.04319.55
5.4.440.2430.03319.18
5.4.430.1030.04719.38
5.4.420.0070.07319.16
5.4.410.0030.08019.26
5.4.400.1670.04019.20
5.4.390.2500.04719.24
5.4.380.2700.04318.95
5.4.370.2630.03719.15
5.4.360.2870.02319.07
5.4.350.2700.04018.87
5.4.340.2630.03319.23
5.4.320.2700.03319.02
5.4.310.2670.04719.09
5.4.300.2470.04019.14
5.4.290.2330.03719.17
5.4.280.2400.03019.06
5.4.270.2300.04018.97
5.4.260.2600.03719.24
5.4.250.2600.03719.21
5.4.240.1430.03719.19
5.4.230.0030.03718.98
5.4.220.0100.06719.16
5.4.210.1830.03319.24
5.4.200.2700.03318.86
5.4.190.2430.04319.18
5.4.180.2730.04318.97
5.4.170.2570.03319.21
5.4.160.2970.05019.16
5.4.150.2700.04018.93
5.4.140.1600.03716.52
5.4.130.0000.03716.34
5.4.120.0030.03716.39
5.4.110.1870.04016.42
5.4.100.2530.03716.46
5.4.90.2370.03316.45
5.4.80.2470.04016.46
5.4.70.2370.04016.52
5.4.60.2430.03016.43
5.4.50.2330.03716.17
5.4.40.2470.03716.33
5.4.30.2500.03716.33
5.4.20.2530.03016.25
5.4.10.2400.02716.53
5.4.00.2430.03015.80
5.3.290.2700.04014.59
5.3.280.2470.04014.52
5.3.270.2470.04014.70
5.3.260.2670.05014.64
5.3.250.2270.03014.63
5.3.240.2430.03314.53
5.3.230.2330.04014.61
5.3.220.2670.04714.80
5.3.210.2370.03714.66
5.3.200.2330.03714.55
5.3.190.2630.03314.63
5.3.180.2500.04014.66
5.3.170.2370.03714.82
5.3.160.1130.04714.55
5.3.150.0130.05314.49
5.3.140.0130.06714.64
5.3.130.2130.05314.46
5.3.120.2730.04314.54
5.3.110.2500.04314.48
5.3.100.2430.03314.05
5.3.90.2530.03314.02
5.3.80.2670.04314.18
5.3.70.2370.03014.05
5.3.60.2530.04314.24
5.3.50.2600.04013.86
5.3.40.2670.03713.96
5.3.30.2630.03014.07
5.3.20.2770.03013.71
5.3.10.2500.03713.64
5.3.00.2770.03713.74
5.2.170.2300.02711.24
5.2.160.2200.03011.11
5.2.150.0570.03711.05
5.2.140.0200.03011.27
5.2.130.0230.02711.12
5.2.120.0200.04311.26
5.2.110.0170.03311.01
5.2.100.0230.05711.02
5.2.90.0200.03311.04
5.2.80.0170.03011.01
5.2.70.0170.02711.02
5.2.60.0200.05710.97
5.2.50.0170.05310.97
5.2.40.0100.03710.91
5.2.30.0100.03010.95
5.2.20.0170.04310.92
5.2.10.0070.03310.79
5.2.00.0130.02710.89
5.1.60.0170.0309.93
5.1.50.0270.0509.88
5.1.40.0030.03010.16
5.1.30.0100.02710.25
5.1.20.0100.03010.43
5.1.10.0130.06010.24
5.1.00.0100.02710.01
5.0.50.0070.0208.61
5.0.40.0070.0278.54
5.0.30.0100.0278.13
5.0.20.0030.0208.46
5.0.10.0070.0378.18
5.0.00.0070.0308.14
4.4.90.0030.0178.10
4.4.80.0070.0138.10
4.4.70.0000.0208.10
4.4.60.0070.0138.10
4.4.50.0030.0238.10
4.4.40.0070.0278.10
4.4.30.0030.0238.10
4.4.20.0070.0178.10
4.4.10.0070.0278.10
4.4.00.0030.0308.10
4.3.110.0070.0178.10
4.3.100.0030.0178.10
4.3.90.0030.0178.10
4.3.80.0030.0278.10
4.3.70.0070.0178.10
4.3.60.0070.0238.10
4.3.50.0030.0208.10
4.3.40.0070.0278.10
4.3.30.0030.0178.10
4.3.20.0000.0208.10
4.3.10.0030.0178.10
4.3.00.0070.0138.10

preferences:
34.03 ms | 401 KiB | 5 Q