3v4l.org

run code in 300+ PHP versions simultaneously
<?php final class CommandId { private $name; private $timestamp; public function __construct($name) { $this->name = (string) $name; $this->timestamp = microtime(); } public static function fromString($anId) { $parts = explode('_', $anId); $id = new static($parts[0]); $id->timestamp = (int) $parts[1]; return $id; } public function name() { return $this->name; } public function timestamp() { return $this->timestamp; } public function __toString() { return "{$this->name}_{$this->timestamp}"; } } echo CommandId::fromString('Foo_' . microtime());

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.3.00.0100.00716.21
7.2.130.0150.00316.56
7.2.120.0120.00616.61
7.2.110.0090.00316.68
7.2.100.0060.00916.99
7.2.90.0090.00616.89
7.2.80.0120.00317.13
7.2.70.0070.01016.84
7.2.60.0110.00716.80
7.2.50.0120.00316.95
7.2.40.0130.00316.98
7.2.30.0030.01316.90
7.2.20.0120.00316.61
7.2.10.0090.00616.84
7.2.00.0060.00617.11
7.1.250.0100.00315.67
7.1.240.0070.00715.44
7.1.230.0120.00815.66
7.1.220.0140.00315.78
7.1.210.0030.01215.75
7.1.200.0110.00415.71
7.1.190.0040.01215.91
7.1.180.0030.01015.93
7.1.170.0000.01615.65
7.1.160.0070.00715.70
7.1.150.0070.00715.07
7.1.140.0070.00715.51
7.1.130.0030.01715.54
7.1.120.0030.00915.69
7.1.110.0080.00415.61
7.1.100.0070.00715.67
7.1.90.0120.00615.81
7.1.80.0100.01015.60
7.1.70.0060.00916.33
7.1.60.0040.00916.42
7.1.50.0080.01516.12
7.1.40.0110.00415.72
7.1.30.0140.00315.66
7.1.20.0160.00315.61
7.1.10.0090.00615.42
7.1.00.0050.02119.05
7.0.330.0060.01015.17
7.0.320.0070.00415.11
7.0.310.0070.00715.31
7.0.300.0040.01115.25
7.0.290.0030.00815.35
7.0.280.0140.00315.36
7.0.270.0120.00315.06
7.0.260.0100.00715.27
7.0.250.0070.00715.19
7.0.240.0070.00715.32
7.0.230.0030.01015.40
7.0.220.0040.00815.36
7.0.210.0070.00715.11
7.0.200.0070.00515.79
7.0.190.0120.00315.42
7.0.180.0070.00714.91
7.0.170.0120.00315.55
7.0.160.0130.00315.11
7.0.150.0070.01115.37
7.0.140.0060.04018.79
7.0.130.0060.00815.28
7.0.120.0140.00315.18
7.0.110.0100.00615.34
7.0.100.0110.00415.06
7.0.90.0080.00614.90
7.0.80.0030.01015.39
7.0.70.2420.02017.51
7.0.60.0080.04717.53
7.0.50.0090.04516.46
7.0.40.0090.02116.73
7.0.30.0120.02216.86
7.0.20.0140.04616.64
7.0.10.0160.03516.69
7.0.00.0030.03116.55
5.6.380.0000.01214.45
5.6.370.0030.00614.67
5.6.360.0030.01014.09
5.6.350.0000.01314.24
5.6.340.0030.01014.48
5.6.330.0100.00314.04
5.6.320.0030.01014.25
5.6.310.0080.00814.23
5.6.300.0070.00414.39
5.6.290.0080.00314.35
5.6.280.0050.04117.62
5.6.270.0070.00314.12
5.6.260.0060.00614.25
5.6.250.0030.01014.37
5.6.240.0060.00614.20
5.6.230.0100.00714.19
5.6.220.0030.00714.21
5.6.210.0090.04317.49
5.6.200.0110.02716.11
5.6.190.0090.03117.45
5.6.180.0080.03717.39
5.6.170.0170.04117.24
5.6.160.0090.04517.23
5.6.150.0070.04316.10
5.6.140.0110.04016.07
5.6.130.0070.04316.22
5.6.120.0110.04517.70
5.6.110.0090.04117.66
5.6.100.0070.02817.63
5.6.90.0040.04217.64
5.6.80.0150.04017.34
5.6.70.0070.04117.41
5.6.60.0150.00714.43
5.6.50.0150.00414.47
5.6.40.0120.00614.18
5.6.30.0070.01214.28
5.6.20.0150.00514.45
5.6.10.0070.01014.45
5.6.00.0110.00814.45
5.5.380.0040.00410.88
5.5.370.0040.00411.11
5.5.360.0110.00010.66
5.5.350.0050.04215.82
5.5.340.0080.02014.44
5.5.330.0080.04015.57
5.5.320.0050.04515.56
5.5.310.0150.03815.58
5.5.300.0080.04214.73
5.5.290.0030.02514.60
5.5.280.0090.02916.07
5.5.270.0070.02716.01
5.5.260.0020.04416.04
5.5.250.0080.04215.77
5.5.240.0090.02015.44
5.5.230.0060.00610.76
5.5.220.0000.00911.32
5.5.210.0070.00311.16
5.5.200.0060.00611.30
5.5.190.0030.00511.09
5.5.180.0060.00611.01
5.5.170.0100.00211.09
5.5.160.0070.00410.82
5.5.150.0100.00011.28
5.5.140.0060.00611.00
5.5.130.0040.00711.15
5.5.120.0060.00310.90
5.5.110.0000.01211.27
5.5.100.0060.00611.20
5.5.90.0090.00011.02
5.5.80.0060.00610.67
5.5.70.0060.00310.84
5.5.60.0030.00311.04
5.5.50.0000.00910.91
5.5.40.0070.00311.26
5.5.30.0030.00610.84
5.5.20.0030.00910.96
5.5.10.0000.01010.78
5.5.00.0030.00710.98
5.4.450.0050.03815.27
5.4.440.0180.02715.38
5.4.430.0100.03415.37
5.4.420.0050.03815.21
5.4.410.0120.03715.17
5.4.400.0100.03115.03
5.4.390.0100.03115.20
5.4.380.0110.02814.95
5.4.370.0050.02514.75
5.4.360.0050.02214.87
5.4.350.0040.02311.49
5.4.340.0040.02211.39
5.4.330.0060.00310.57
5.4.320.0060.02211.74
5.4.310.0080.02111.67
5.4.300.0040.02311.68
5.4.290.0050.02211.82
5.4.280.0060.02111.70
5.4.270.0050.02311.73
5.4.260.0020.02711.78
5.4.250.0050.03314.85
5.4.240.0080.02714.87
5.4.230.0030.03414.83
5.4.220.0080.03614.98
5.4.210.0050.04214.86
5.4.200.0070.03014.98
5.4.190.0070.02914.88
5.4.180.0100.02814.94
5.4.170.0070.03514.79
5.4.160.0050.02814.90
5.4.150.0050.03014.75
5.4.140.0030.03113.69
5.4.130.0080.02713.71
5.4.120.0070.02813.76
5.4.110.0040.02913.74
5.4.100.0030.02913.52
5.4.90.0060.02613.74
5.4.80.0040.03213.69
5.4.70.0050.03513.85
5.4.60.0050.02513.63
5.4.50.0030.02813.83
5.4.40.0080.02313.88
5.4.30.0080.02513.78
5.4.20.0050.02713.87
5.4.10.0090.02813.87
5.4.00.0030.02813.51
5.3.290.0090.02211.63
5.3.280.0100.04112.60
5.3.270.0060.03512.67
5.3.260.0090.03012.63
5.3.250.0030.02712.71
5.3.240.0000.03512.53
5.3.230.0050.03112.67
5.3.220.0020.02812.49
5.3.210.0070.02712.56
5.3.200.0070.02912.52
5.3.190.0030.03012.51
5.3.180.0100.02212.51
5.3.170.0070.03912.68
5.3.160.0050.03112.48
5.3.150.0130.03312.63
5.3.140.0150.02212.63
5.3.130.0070.02812.52
5.3.120.0060.03012.59
5.3.110.0110.02412.57
5.3.100.0150.02812.39
5.3.90.0050.02912.17
5.3.80.0070.02712.24
5.3.70.0100.03512.33
5.3.60.0060.02712.20
5.3.50.0070.03312.33
5.3.40.0020.03412.34
5.3.30.0120.02212.28
5.3.20.0120.03212.13
5.3.10.0070.02712.04
5.3.00.0090.02511.99
5.2.170.0060.02110.74
5.2.160.0100.02710.65
5.2.150.0080.02210.69
5.2.140.0070.02210.67
5.2.130.0060.02210.76
5.2.120.0080.02910.67
5.2.110.0070.02010.72
5.2.100.0030.02310.63
5.2.90.0060.02210.72
5.2.80.0060.02610.66
5.2.70.0050.02510.71
5.2.60.0060.02110.57
5.2.50.0080.02710.68
5.2.40.0050.02110.62
5.2.30.0060.02310.62
5.2.20.0050.02410.64
5.2.10.0050.02010.55
5.2.00.0040.02410.50
5.1.60.0040.01810.13
5.1.50.0070.01510.13
5.1.40.0050.02010.16
5.1.30.0030.02410.34
5.1.20.0050.02610.39
5.1.10.0060.01810.19
5.1.00.0040.01910.29
5.0.50.0050.0139.32
5.0.40.0030.0179.31
5.0.30.0050.0209.34
5.0.20.0020.0159.27
5.0.10.0030.0179.20
5.0.00.0060.0219.30
4.4.90.0030.0158.82
4.4.80.0040.0088.82
4.4.70.0040.0098.82
4.4.60.0020.0158.82
4.4.50.0010.0128.82
4.4.40.0050.0178.82
4.4.30.0050.0118.82
4.4.20.0030.0138.82
4.4.10.0020.0148.82
4.4.00.0040.0178.82
4.3.110.0040.0088.82
4.3.100.0030.0118.82
4.3.90.0050.0098.82
4.3.80.0010.0208.82
4.3.70.0020.0168.82
4.3.60.0020.0148.82
4.3.50.0020.0138.82
4.3.40.0020.0218.82
4.3.30.0040.0118.82
4.3.20.0030.0118.82
4.3.10.0020.0128.82
4.3.00.0030.0118.76

preferences:
33.84 ms | 401 KiB | 5 Q