3v4l.org

run code in 300+ PHP versions simultaneously
<?php final class CommandId { private $name; private $time; public function __construct($name) { $this->time = microtime(true); $this->name = trim($name); if (empty($this->name)) { throw new DomainException('Name must not be empty'); } } public static function fromString($idString) { $parts = explode('_', $idString); if (count($parts) != 2) { throw new DomainException("Unexpected format [$idString]"); } $id = new static($parts[0]); $id->time = (float) $parts[1]; return $id; } public function name() { return $this->name; } public function time() { return $this->time; } public function __toString() { return "{$this->name}_{$this->time}"; } } $one = new CommandId('foo'); $two = new CommandId('foo'); assert($one != $two, 'one should not equal 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.4.00.0100.00915.14
7.3.120.0070.01014.70
7.3.110.0060.01214.75
7.3.100.0060.00814.71
7.3.90.0140.00414.96
7.3.80.0130.00314.79
7.3.70.0000.01914.94
7.3.60.0030.01214.49
7.3.50.0030.01314.63
7.3.40.0120.00314.78
7.3.30.0100.00014.70
7.3.20.0040.01416.58
7.3.10.0110.00316.59
7.3.00.0040.00816.59
7.2.250.0030.01615.35
7.2.240.0100.00715.13
7.2.230.0040.00815.34
7.2.220.0130.00314.84
7.2.210.0030.01315.17
7.2.200.0060.01314.98
7.2.190.0090.00015.21
7.2.180.0060.00915.11
7.2.170.0000.01515.05
7.2.00.0000.01819.63
7.1.330.0060.00915.65
7.1.320.0040.01415.77
7.1.310.0150.00015.77
7.1.300.0040.01215.79
7.1.290.0000.01515.77
7.1.280.0090.00315.75
7.1.270.0060.01215.58
7.1.260.0100.00715.81
7.1.70.0040.00417.23
7.1.60.0070.01319.43
7.1.50.0070.01416.97
7.1.00.0030.03322.32
7.0.200.0160.00616.50
7.0.140.0070.07022.15
7.0.60.0200.06719.89
7.0.50.0000.05717.89
7.0.40.0130.07720.20
7.0.30.0400.06720.17
7.0.20.0100.04720.10
7.0.10.0300.05320.10
7.0.00.0130.07020.09
5.6.280.0070.06721.01
5.6.210.0000.08720.54
5.6.200.0070.08318.13
5.6.190.0130.08020.56
5.6.180.0170.09020.59
5.6.170.0400.07020.56
5.6.160.0070.05320.55
5.6.150.0100.07718.14
5.6.140.0130.07318.22
5.6.130.0130.08018.27
5.6.120.0070.05021.09
5.6.110.0070.06020.99
5.6.100.0070.09021.14
5.6.90.0070.07321.00
5.6.80.0100.07720.54
5.5.350.0370.07020.43
5.5.340.0170.07017.96
5.5.330.0100.03720.25
5.5.320.0100.04720.35
5.5.310.0100.04720.23
5.5.300.0130.03318.04
5.5.290.0130.07317.96
5.5.280.0070.08320.78
5.5.270.0100.04020.78
5.5.260.0000.08720.88
5.5.250.0070.07720.59
5.5.240.0230.06720.16
5.4.450.0270.03719.39
5.4.440.0300.04019.52
5.4.430.0400.06719.63
5.4.420.0300.04719.46
5.4.410.0270.07319.29
5.4.400.0270.06719.15
5.4.390.0300.07318.94
5.4.380.0270.04719.31
5.4.370.0300.04018.95
5.4.360.0300.07018.87
5.4.350.0370.06719.30
5.4.340.0330.07019.23
5.4.320.0270.07319.15
5.4.310.0300.06319.08
5.4.300.0330.06719.21
5.4.290.0370.04719.09
5.4.280.0270.06719.24
5.4.270.0270.07318.95
5.4.260.0270.07319.31
5.4.250.0330.05319.21
5.4.240.0300.03318.98
5.4.230.0330.07018.98
5.4.220.0200.04719.21
5.4.210.0330.04319.14
5.4.200.0300.07319.23
5.4.190.0330.06719.07
5.4.180.0300.07718.93
5.4.170.0370.07019.23
5.4.160.0370.04019.22
5.4.150.0300.06019.20
5.4.140.0400.06316.46
5.4.130.0300.04016.35
5.4.120.0230.06016.72
5.4.110.0330.04716.19
5.4.100.0300.07016.58
5.4.90.0300.07016.57
5.4.80.0270.04316.26
5.4.70.0370.05716.54
5.4.60.0430.05316.35
5.4.50.0430.06016.49
5.4.40.0330.04016.56
5.4.30.0230.07316.54
5.4.20.0270.07016.48
5.4.10.0300.07016.16
5.4.00.0230.04715.85
5.3.290.0300.06014.59
5.3.280.0270.04714.51
5.3.270.0270.07014.78
5.3.260.0270.08014.62
5.3.250.0300.05314.54
5.3.240.0270.07314.53
5.3.230.0300.07714.82
5.3.220.0330.07014.69
5.3.210.0230.04014.59
5.3.200.0370.06314.58
5.3.190.0300.07314.55
5.3.180.0230.04014.73
5.3.170.0370.06714.48
5.3.160.0330.07014.65
5.3.150.0400.06314.75
5.3.140.0430.06014.62
5.3.130.0230.04314.71
5.3.120.0400.06014.60
5.3.110.0270.07714.48
5.3.100.0270.03314.02
5.3.90.0270.03713.94
5.3.80.0370.05714.08
5.3.70.0330.05714.25
5.3.60.0370.06314.13
5.3.50.0300.07014.04
5.3.40.0300.07013.89
5.3.30.0230.03313.97
5.3.20.0230.04013.87
5.3.10.0300.04313.74
5.3.00.0330.06313.75
5.2.170.0230.06312.10
5.2.160.0300.05012.10
5.2.150.0200.03012.10
5.2.140.0200.03012.10
5.2.130.0170.03312.10
5.2.120.0230.05712.10
5.2.110.0270.05012.10
5.2.100.0300.05312.10
5.2.90.0330.03712.10
5.2.80.0170.04012.10
5.2.70.0200.03012.10
5.2.60.0230.06012.10
5.2.50.0200.05312.10
5.2.40.0170.03712.10
5.2.30.0200.05712.10
5.2.20.0170.04012.10
5.2.10.0270.05012.10
5.2.00.0170.04012.10
5.1.60.0170.05312.10
5.1.50.0230.04012.10
5.1.40.0100.03312.10
5.1.30.0230.05312.10
5.1.20.0200.03012.10
5.1.10.0230.03712.10
5.1.00.0170.03012.10
5.0.50.0100.04012.10
5.0.40.0130.03312.10
5.0.30.0100.06712.10
5.0.20.0100.03012.10
5.0.10.0130.04012.10
5.0.00.0170.06012.10
4.4.90.0100.02712.10
4.4.80.0100.02712.10
4.4.70.0130.03012.10
4.4.60.0100.02012.10
4.4.50.0100.02012.10
4.4.40.0100.04712.10
4.4.30.0130.01712.10
4.4.20.0130.03312.10
4.4.10.0130.03012.10
4.4.00.0070.05312.10
4.3.110.0100.02012.10
4.3.100.0070.03712.10
4.3.90.0130.01712.10
4.3.80.0100.05312.10
4.3.70.0130.02312.10
4.3.60.0130.01712.10
4.3.50.0130.01712.10
4.3.40.0170.04312.10
4.3.30.0000.03712.10
4.3.20.0030.03012.10
4.3.10.0030.03312.10
4.3.00.0070.03712.10

preferences:
32.32 ms | 400 KiB | 5 Q