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'); assert($one == $two); var_dump($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.10.0100.00716.27
7.4.00.0070.01016.26
7.3.130.0070.01316.51
7.3.120.0030.01616.56
7.3.110.0070.01116.55
7.3.100.0070.01116.44
7.3.90.0110.00416.38
7.3.80.0090.00316.50
7.3.70.0040.01116.35
7.3.60.0070.00716.41
7.3.50.0060.01016.41
7.3.40.0060.00916.34
7.3.30.0090.00316.23
7.3.20.0030.01018.15
7.3.10.0070.00718.09
7.3.00.0090.00318.25
7.2.260.0070.01316.39
7.2.250.0060.01216.35
7.2.240.0130.00616.67
7.2.230.0090.00916.53
7.2.220.0060.00916.50
7.2.210.0040.00416.56
7.2.200.0060.00916.44
7.2.190.0070.01016.41
7.2.180.0060.00616.43
7.2.170.0060.01016.57
7.2.160.0080.00816.50
7.2.150.0070.01018.55
7.2.140.0070.01018.41
7.2.130.0090.00918.31
7.2.120.0000.01018.43
7.2.110.0090.00318.46
7.2.100.0130.00318.38
7.2.90.0100.01018.36
7.2.80.0090.00618.32
7.2.70.0080.00818.24
7.2.60.0040.00818.41
7.2.50.0030.00918.36
7.2.40.0060.00618.56
7.2.30.0070.01118.62
7.2.20.0070.00718.54
7.2.10.0040.01418.32
7.2.00.0050.00919.00
7.1.330.0120.00317.48
7.1.320.0060.00917.42
7.1.310.0030.01617.39
7.1.300.0030.01217.35
7.1.290.0030.01217.29
7.1.280.0080.00817.30
7.1.270.0070.00417.40
7.1.260.0090.00717.48
7.1.250.0060.00917.46
7.1.240.0060.00817.21
7.1.230.0040.01117.22
7.1.220.0070.01017.25
7.1.210.0070.00717.27
7.1.200.0040.00717.36
7.1.190.0000.01417.34
7.1.180.0000.01017.34
7.1.170.0070.01017.18
7.1.160.0000.01417.36
7.1.150.0100.00717.17
7.1.140.0040.01117.29
7.1.130.0050.00517.24
7.1.120.0070.01017.31
7.1.110.0040.01117.32
7.1.100.0090.00317.30
7.1.90.0090.00917.25
7.1.80.0030.01317.35
7.1.70.0020.00917.22
7.1.60.0080.01218.40
7.1.50.0080.01216.95
7.1.40.0070.01017.48
7.1.30.0090.00917.20
7.1.20.0100.00317.26
7.1.10.0120.00317.41
7.1.00.0060.02019.71
7.0.330.0000.01617.03
7.0.320.0090.00317.12
7.0.310.0070.00717.19
7.0.300.0030.00716.97
7.0.290.0030.01316.96
7.0.280.0070.00717.12
7.0.270.0070.00716.94
7.0.260.0100.01017.02
7.0.250.0000.01617.25
7.0.240.0000.01516.96
7.0.230.0120.00316.96
7.0.220.0040.01217.23
7.0.210.0060.00917.01
7.0.200.0100.00816.94
7.0.190.0060.00917.14
7.0.180.0070.01017.01
7.0.170.0060.00916.98
7.0.160.0060.00917.14
7.0.150.0030.00617.05
7.0.140.0080.03719.51
7.0.130.0080.00417.07
7.0.120.0000.01417.01
7.0.110.0060.00817.16
7.0.100.0030.01416.98
7.0.90.0040.01117.02
7.0.80.0070.01117.02
7.0.70.0110.00417.06
7.0.60.0100.03118.54
7.0.50.0080.04117.39
7.0.40.0070.04717.65
7.0.30.0130.03317.57
7.0.20.0130.04817.52
7.0.10.0020.04217.55
7.0.00.0070.02317.56
5.6.400.0070.00716.07
5.6.390.0030.01315.79
5.6.380.0030.01015.80
5.6.370.0040.01116.26
5.6.360.0030.01215.70
5.6.350.0100.00715.84
5.6.340.0040.00815.73
5.6.330.0030.01215.79
5.6.320.0090.00915.95
5.6.310.0030.01016.12
5.6.300.0030.01416.01
5.6.290.0060.00916.11
5.6.280.0090.03918.59
5.6.270.0090.00615.83
5.6.260.0090.00615.95
5.6.250.0070.01015.77
5.6.240.0040.01416.04
5.6.230.0000.01615.80
5.6.220.0030.00716.09
5.6.210.0020.04918.25
5.6.200.0100.04016.96
5.6.190.0120.02518.27
5.6.180.0210.04118.19
5.6.170.0270.03918.13
5.6.160.0070.04218.17
5.6.150.0030.02617.15
5.6.140.0020.05117.03
5.6.130.0060.04517.05
5.6.120.0030.04918.54
5.6.110.0020.04818.57
5.6.100.0080.04218.49
5.6.90.0070.04418.39
5.6.80.0050.02618.01
5.6.70.2080.02618.09
5.6.60.0050.00515.81
5.6.50.0070.00715.85
5.6.40.0130.00315.86
5.6.30.0060.01216.14
5.6.20.0050.00815.79
5.6.10.0070.01115.81
5.6.00.0030.01215.80
5.5.380.0030.00915.72
5.5.370.0060.01015.72
5.5.360.0080.00815.73
5.5.350.0110.03017.97
5.5.340.0100.04016.93
5.5.330.0070.03217.99
5.5.320.0130.04318.01
5.5.310.0180.04017.88
5.5.300.0120.03816.87
5.5.290.0070.04216.94
5.5.280.0080.04318.49
5.5.270.0080.03018.37
5.5.260.0120.04218.47
5.5.250.0080.03718.21
5.5.240.0070.03717.96
5.5.230.0040.01115.80
5.5.220.0070.01015.78
5.5.210.0030.01015.78
5.5.200.0030.01215.84
5.5.190.0030.01315.79
5.5.180.0090.00015.77
5.5.170.0040.01115.86
5.5.160.0090.00615.74
5.5.150.0070.00715.75
5.5.140.0100.00715.39
5.5.130.0160.00015.72
5.5.120.0000.01115.77
5.5.110.0040.00815.81
5.5.100.0060.00915.49
5.5.90.0070.00715.68
5.5.80.0060.01015.75
5.5.70.0090.00615.76
5.5.60.0070.01015.62
5.5.50.0100.00715.75
5.5.40.0140.00015.71
5.5.30.0130.00315.61
5.5.20.0030.01015.75
5.5.10.0120.00415.61
5.5.00.0000.01315.69
5.4.450.0800.02216.06
5.4.440.0870.02216.07
5.4.430.0900.02416.02
5.4.420.0900.01815.92
5.4.410.0880.02315.98
5.4.400.0880.02515.98
5.4.390.0960.02915.93
5.4.380.0820.02815.89
5.4.370.0950.02715.71
5.4.360.0910.02815.77
5.4.350.0820.02915.96
5.4.340.0830.02015.75
5.4.330.0030.01012.69
5.4.320.0960.02115.73
5.4.310.0800.02115.85
5.4.300.0950.02215.80
5.4.290.0880.02515.96
5.4.280.0920.02615.87
5.4.270.0920.02815.76
5.4.260.0780.02315.76
5.4.250.0830.01815.85
5.4.240.0920.02515.59
5.4.230.0880.02215.58
5.4.220.0900.02715.73
5.4.210.0910.02315.79
5.4.200.0850.01915.83
5.4.190.0950.02515.85
5.4.180.0730.02515.79
5.4.170.0520.02915.80
5.4.160.0070.02415.93
5.4.150.0030.04015.77
5.4.140.0780.02614.53
5.4.130.0920.02314.50
5.4.120.0930.02514.52
5.4.110.0920.02314.56
5.4.100.0910.02214.66
5.4.90.0800.01814.43
5.4.80.0800.02014.50
5.4.70.0850.02114.42
5.4.60.0840.02714.59
5.4.50.0850.01914.40
5.4.40.0130.02214.47
5.4.30.0130.03014.46
5.4.20.0120.02814.58
5.4.10.0120.02914.41
5.4.00.0130.02314.21
5.3.290.0140.02613.95
5.3.280.0120.04213.77
5.3.270.0170.02713.82
5.3.260.0130.03713.93
5.3.250.0160.02613.94
5.3.240.0180.02313.83
5.3.230.0170.04013.86
5.3.220.0160.03613.81
5.3.210.0100.02513.70
5.3.200.0150.03713.71
5.3.190.0180.03813.74
5.3.180.0120.02213.82
5.3.170.0120.02713.87
5.3.160.0110.02513.83
5.3.150.0050.02813.97
5.3.140.0130.02313.86
5.3.130.0120.04013.84
5.3.120.0070.02313.78
5.3.110.0150.04013.79
5.3.100.0090.02413.51
5.3.90.0120.03413.53
5.3.80.0130.02513.40
5.3.70.0100.02713.49
5.3.60.0080.02213.54
5.3.50.0180.01913.45
5.3.40.0130.03513.51
5.3.30.0080.02713.57
5.3.20.0140.03613.34
5.3.10.0130.01913.25
5.3.00.0120.02013.30
5.2.170.0130.02711.06
5.2.160.0130.03011.21
5.2.150.0100.03311.06
5.2.140.0170.02711.10
5.2.130.0100.03311.02
5.2.120.0130.02711.02
5.2.110.0170.02311.11
5.2.100.0100.02711.06
5.2.90.0130.02311.08
5.2.80.0100.03311.02
5.2.70.0200.02311.19
5.2.60.0100.05311.16
5.2.50.0200.02311.11
5.2.40.0100.03010.93
5.2.30.0100.03010.88
5.2.20.0100.03010.87
5.2.10.0170.03711.11
5.2.00.0170.03310.84
5.1.60.0170.0209.99
5.1.50.0070.0379.98
5.1.40.0070.02710.06
5.1.30.0130.02710.26
5.1.20.0070.03010.28
5.1.10.0130.03010.10
5.1.00.0100.03310.01
5.0.50.0070.0208.54
5.0.40.0070.0208.50
5.0.30.0100.0308.14
5.0.20.0030.0208.29
5.0.10.0030.0208.31
5.0.00.0070.0408.07
4.4.90.0030.0177.72
4.4.80.0030.0177.72
4.4.70.0030.0177.72
4.4.60.0030.0307.72
4.4.50.0070.0377.72
4.4.40.0070.0237.72
4.4.30.0030.0237.72
4.4.20.0030.0207.72
4.4.10.0000.0307.72
4.4.00.0030.0307.72
4.3.110.0030.0377.72
4.3.100.0030.0177.72
4.3.90.0100.0277.72
4.3.80.0030.0337.72
4.3.70.0070.0237.72
4.3.60.0100.0137.72
4.3.50.0100.0307.72
4.3.40.0030.0377.72
4.3.30.0000.0337.72
4.3.20.0000.0277.72
4.3.10.0000.0237.72
4.3.00.0000.0177.72

preferences:
39.52 ms | 401 KiB | 5 Q