3v4l.org

run code in 300+ PHP versions simultaneously
<?php final class CommandId { private $name; private $time; public function __construct($name) { $this->time = microtime(); $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 = (int) $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'); var_dump($one, $two, assert($one == $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.0080.00815.15
7.3.120.0090.01215.05
7.3.110.0040.01414.93
7.3.100.0100.00715.05
7.3.90.0000.00914.83
7.3.80.0060.01214.98
7.3.70.0060.00614.84
7.3.60.0080.00614.73
7.3.50.0100.00314.92
7.3.40.0070.00714.73
7.3.30.0040.01114.89
7.3.20.0030.01016.55
7.3.10.0050.01316.64
7.3.00.0080.00716.49
7.2.250.0170.00315.20
7.2.240.0100.01015.04
7.2.230.0060.00914.88
7.2.220.0090.00315.15
7.2.210.0060.00915.00
7.2.200.0040.01214.98
7.2.190.0060.00914.91
7.2.180.0080.00815.08
7.2.170.0030.01315.05
7.2.130.0110.00716.44
7.2.120.0130.00716.83
7.2.110.0070.01016.88
7.2.100.0110.00716.86
7.2.90.0070.00716.93
7.2.80.0030.01016.44
7.2.70.0030.00916.83
7.2.60.0000.01416.68
7.2.50.0030.01216.72
7.2.40.0100.00716.75
7.2.30.0100.00316.82
7.2.20.0030.01316.86
7.2.10.0150.00616.93
7.2.00.0060.00618.00
7.1.330.0030.01015.84
7.1.320.0070.00315.86
7.1.310.0060.00915.87
7.1.300.0030.00915.76
7.1.290.0030.01015.85
7.1.280.0040.00815.72
7.1.270.0070.00715.57
7.1.260.0150.00015.72
7.1.250.0070.01115.46
7.1.70.0030.01017.27
7.1.60.0110.00417.09
7.1.50.0080.00816.89
7.1.40.0070.01016.42
7.1.30.0110.00416.75
7.1.20.0060.01316.71
7.1.10.0060.00616.62
7.1.00.0060.00316.59
7.0.200.0090.00316.79
7.0.190.0000.01116.36
7.0.180.0110.00216.48
7.0.170.0070.00716.43
7.0.160.0120.00016.46
7.0.150.0070.01116.27
7.0.140.0090.00616.40
7.0.130.0000.01216.41
7.0.120.0070.00416.64
7.0.110.0030.01216.39
7.0.100.0090.00916.45
7.0.90.0100.00816.29
7.0.80.0070.00716.32
7.0.70.0040.00816.37
7.0.60.0050.01515.98
7.0.50.0080.00816.64
7.0.40.0080.00515.29
7.0.30.0090.00315.29
7.0.20.0040.00415.29
7.0.10.0000.01415.29
7.0.00.0000.00815.29
5.6.300.0110.03920.91
5.6.290.0030.09420.68
5.6.280.0090.04120.98
5.6.270.0030.09320.83
5.6.260.0140.08520.83
5.6.250.0060.08821.01
5.6.240.0140.08220.91
5.6.230.0070.04920.96
5.6.220.0100.04120.90
5.6.210.0000.06721.07
5.6.200.0070.04520.87
5.6.190.0030.04321.04
5.6.180.0100.03920.84
5.6.170.0030.08920.95
5.6.160.0030.05520.81
5.6.150.0180.03520.97
5.6.140.0070.04520.84
5.6.130.0100.03720.83
5.6.120.0070.04420.83
5.6.110.0030.04820.96
5.6.100.0030.04220.77
5.6.90.0030.03921.03
5.6.80.0000.04520.25
5.6.70.0070.03420.15
5.6.60.0100.03220.15
5.6.50.0060.03920.35
5.6.40.0030.04120.20
5.6.30.0100.03620.30
5.6.20.0030.03820.19
5.6.10.0000.04320.41
5.6.00.0140.04120.37
5.5.380.0100.08717.47
5.5.370.0000.04517.63
5.5.360.0100.07817.62
5.5.350.0070.07617.54
5.5.340.0000.04418.05
5.5.330.0030.04418.06
5.5.320.0000.04718.09
5.5.310.0030.04318.18
5.5.300.0030.04018.17
5.5.290.0070.03618.13
5.5.280.0030.04118.05
5.5.270.0000.04318.13
5.5.260.0030.03918.13
5.5.250.0030.04017.90
5.5.240.0000.04217.39
5.5.230.0060.04217.57
5.5.220.0000.04617.50
5.5.210.0030.03717.47
5.5.200.0000.04517.45
5.5.190.0060.03617.19
5.5.180.0000.04117.44
5.5.160.0070.03617.39
5.5.150.0030.04117.42
5.5.140.0060.03517.35
5.5.130.0000.04117.45
5.5.120.0030.04617.20
5.5.110.0000.04017.48
5.5.100.0030.03817.09
5.5.90.0030.08716.97
5.5.80.0030.03817.43
5.5.70.0100.03117.31
5.5.60.0030.04017.25
5.5.50.0000.08217.26
5.5.40.0000.04117.34
5.5.30.0030.04117.24
5.5.20.0060.05517.30
5.5.10.0030.03817.27
5.5.00.0030.03817.07
5.4.450.0070.03719.32
5.4.440.0000.04819.30
5.4.430.0000.04219.38
5.4.420.0240.03119.42
5.4.410.0000.04419.09
5.4.400.0030.03619.11
5.4.390.0000.04019.20
5.4.380.0000.04019.23
5.4.370.0000.07319.12
5.4.360.0100.03718.94
5.4.350.0040.04319.21
5.4.340.0030.03819.20
5.4.320.0030.04318.98
5.4.310.0060.03419.10
5.4.300.0000.04019.04
5.4.290.0030.04218.97
5.4.280.0070.04619.20
5.4.270.0030.03918.93
5.4.260.0000.04419.05
5.4.250.0090.03819.07
5.4.240.0030.04318.97
5.4.230.0030.04818.89
5.4.220.0130.05219.04
5.4.210.0030.04419.13
5.4.200.0000.04519.06
5.4.190.0030.05519.14
5.4.180.0090.03419.09
5.4.170.0030.03818.97
5.4.160.0030.04318.96
5.4.150.0230.04919.18
5.4.140.0000.04516.45
5.4.130.0040.03616.45
5.4.120.0000.04216.70
5.4.110.0030.04216.74
5.4.100.0000.03716.79
5.4.90.0030.03916.74
5.4.80.0060.03216.67
5.4.70.0120.03416.70
5.4.60.0060.03116.71
5.4.50.0000.05816.66
5.4.40.0000.03916.76
5.4.30.0000.03816.65
5.4.20.0060.03516.45
5.4.10.0090.03616.70
5.4.00.0070.03616.03
5.3.290.0040.04615.29
5.3.280.0000.04015.29
5.3.270.0000.04215.29
5.3.260.0070.05115.29
5.3.250.0070.04315.29
5.3.240.0060.03515.29
5.3.230.0060.03415.29
5.3.220.0030.04015.29
5.3.210.0000.04315.29
5.3.200.0040.03715.29
5.3.190.0120.03015.29
5.3.180.0070.03215.29
5.3.170.0100.03415.29
5.3.160.0170.02715.29
5.3.150.0030.03615.29
5.3.140.0130.07615.29
5.3.130.0090.03415.29
5.3.120.0030.04215.29
5.3.110.0060.03615.29
5.3.100.0060.04215.29
5.3.90.0070.03715.29
5.3.80.0030.03715.29
5.3.70.0000.05315.29
5.3.60.0000.04515.29
5.3.50.0000.03915.29
5.3.40.0030.05615.29
5.3.30.0000.04415.29
5.3.20.0030.06615.29
5.3.10.0000.03715.29
5.3.00.0030.03515.29
5.2.170.0000.03315.29
5.2.160.0000.03815.29
5.2.150.0040.02915.29
5.2.140.0100.05515.29
5.2.130.0060.04715.29
5.2.120.0000.03615.29
5.2.110.0030.02815.29
5.2.100.0030.03915.29
5.2.90.0030.05815.29
5.2.80.0030.04815.29
5.2.70.0040.02915.29
5.2.60.0030.03115.29
5.2.50.0030.02915.29
5.2.40.0000.03415.29
5.2.30.0060.02915.29
5.2.20.0030.03115.29
5.2.10.0030.04115.29
5.2.00.0030.03015.29
5.1.60.0090.02115.29
5.1.50.0060.02115.29
5.1.40.0000.02715.29
5.1.30.0030.02715.29
5.1.20.0030.02715.29
5.1.10.0030.02815.29
5.1.00.0000.02815.29
5.0.50.0000.02515.29
5.0.40.0040.01815.29
5.0.30.0030.03215.29
5.0.20.0040.01815.29
5.0.10.0060.01815.29
5.0.00.0090.02715.29
4.4.90.0000.01715.29
4.4.80.0000.01715.29
4.4.70.0030.01515.29
4.4.60.0030.01615.29
4.4.50.0030.01415.29
4.4.40.0000.03215.29
4.4.30.0000.01815.29
4.4.20.0000.02215.29
4.4.10.0030.01515.29
4.4.00.0000.02915.29
4.3.110.0000.01915.29
4.3.100.0000.01915.29
4.3.90.0050.01115.29
4.3.80.0070.02015.29
4.3.70.0000.01715.29
4.3.60.0000.01615.29
4.3.50.0030.01315.29
4.3.40.0030.03615.29
4.3.30.0000.01915.29
4.3.20.0030.01515.29
4.3.10.0070.01315.29
4.3.00.0000.01815.29

preferences:
36.99 ms | 401 KiB | 5 Q