3v4l.org

run code in 300+ PHP versions simultaneously
<?php final class CommandId { private $name; private $time; public function __construct($name) { $this->name = trim($name); $this->time = microtime(); } public static function fromString($idString) { $parts = explode('_', $idString); $id = new static(array_shift($parts)); $id->time = (int) array_pop($parts); return $id; } public function name() { return $this->name; } public function time() { return $this->time; } public function __toString() { return "{$this->name}_{$this->time}"; } } var_dump(CommandId::fromString('Foo_' . time()));

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.0040.01414.76
7.4.00.0060.01214.71
7.3.130.0040.01214.88
7.3.120.0070.01114.70
7.3.110.0050.01014.86
7.3.100.0060.00814.59
7.3.90.0070.00814.62
7.3.80.0030.01014.81
7.3.70.0110.00314.79
7.3.60.0080.00314.71
7.3.50.0040.00514.78
7.3.40.0030.00914.82
7.3.30.0080.00514.77
7.3.20.0030.01016.61
7.3.10.0100.00416.53
7.3.00.0060.00616.60
7.2.260.0070.01114.95
7.2.250.0100.01015.19
7.2.240.0100.00315.00
7.2.230.0080.00714.95
7.2.220.0080.00615.05
7.2.210.0090.00714.99
7.2.200.0060.00915.02
7.2.190.0040.01015.02
7.2.180.0020.01315.04
7.2.170.0020.01215.15
7.2.160.0060.00815.17
7.2.150.0070.00716.90
7.2.140.0060.01116.76
7.2.130.0020.01216.77
7.2.120.0060.00816.86
7.2.110.0050.00916.94
7.2.100.0060.00916.75
7.2.90.0070.00816.91
7.2.80.0080.00616.79
7.2.70.0080.00717.01
7.2.60.0070.00816.94
7.2.50.0060.00617.03
7.2.40.0020.01116.85
7.2.30.0060.00617.00
7.2.20.0050.00916.86
7.2.10.0030.00917.06
7.2.00.0070.00816.92
7.1.330.0100.00415.69
7.1.320.0020.01215.79
7.1.310.0040.00715.65
7.1.300.0040.00815.65
7.1.290.0070.00415.75
7.1.280.0070.00615.73
7.1.270.0020.01015.76
7.1.260.0080.00515.86
7.1.250.0040.00615.64
7.1.240.0040.01215.80
7.1.230.0050.00815.75
7.1.220.0090.00715.59
7.1.210.0060.00615.79
7.1.200.0050.00515.76
7.1.190.0020.01315.61
7.1.180.0020.01015.58
7.1.170.0050.00715.41
7.1.160.0060.00715.71
7.1.150.0070.00615.53
7.1.140.0030.01115.69
7.1.130.0010.01015.86
7.1.120.0030.01115.79
7.1.110.0030.00815.71
7.1.100.0060.00715.46
7.1.90.0050.01015.80
7.1.80.0050.00915.87
7.1.70.0040.01116.00
7.1.60.0080.00417.02
7.1.50.0090.00616.11
7.1.40.0030.01115.70
7.1.30.0070.00715.71
7.1.20.0040.00815.56
7.1.10.0020.01315.63
7.1.00.0050.01617.89
7.0.330.0020.00815.43
7.0.320.0060.00315.30
7.0.310.0060.00615.21
7.0.300.0090.00515.43
7.0.290.0000.01415.36
7.0.280.0060.00615.41
7.0.270.0080.00515.29
7.0.260.0050.00315.45
7.0.250.0070.00515.47
7.0.240.0040.00715.34
7.0.230.0050.00915.53
7.0.220.0070.00915.46
7.0.210.0060.01015.37
7.0.200.0030.00715.89
7.0.190.0030.00515.47
7.0.180.0050.00715.22
7.0.170.0080.00315.31
7.0.160.0040.01015.47
7.0.150.0080.00315.43
7.0.140.0050.02817.55
7.0.130.0010.01215.23
7.0.120.0070.00415.39
7.0.110.0080.00415.45
7.0.100.0080.02216.99
7.0.90.0060.03116.90
7.0.80.0050.03116.86
7.0.70.0040.03516.86
7.0.60.0090.02516.85
7.0.50.0060.03217.10
7.0.40.0060.03115.61
7.0.30.0050.03815.64
7.0.20.0060.03415.60
7.0.10.0090.02415.64
7.0.00.0080.03115.56
5.6.400.0060.00514.46
5.6.390.0050.00814.27
5.6.380.0040.00814.27
5.6.370.0030.01214.25
5.6.360.0090.00714.01
5.6.350.0050.00514.29
5.6.340.0060.00614.51
5.6.330.0050.01114.43
5.6.320.0050.00914.38
5.6.310.0070.00914.63
5.6.300.0040.00714.50
5.6.290.0040.01114.50
5.6.280.0060.02916.61
5.6.270.0050.00914.41
5.6.260.0020.01214.33
5.6.250.0080.02916.45
5.6.240.0050.03216.52
5.6.230.0060.03216.46
5.6.220.0100.01916.43
5.6.210.0090.03016.31
5.6.200.0060.03216.57
5.6.190.0100.02716.54
5.6.180.0040.03716.48
5.6.170.0020.02616.62
5.6.160.0020.02316.52
5.6.150.0060.03216.63
5.6.140.0110.03016.54
5.6.130.0090.02016.54
5.6.120.0060.03516.63
5.6.110.0060.03316.54
5.6.100.0070.03216.63
5.6.90.0070.03516.66
5.6.80.0060.03016.32
5.6.70.0040.02516.28
5.6.60.0070.03116.35
5.6.50.0090.03016.26
5.6.40.0070.02816.35
5.6.30.0070.02916.20
5.6.20.0060.02316.29
5.6.10.0080.02516.19
5.6.00.0050.02716.29
5.5.380.0070.02316.35
5.5.370.0050.03416.31
5.5.360.0080.02016.32
5.5.350.0100.02916.27
5.5.340.0070.02516.45
5.5.330.0090.03416.46
5.5.320.0110.03316.34
5.5.310.0070.02016.35
5.5.300.0050.02116.60
5.5.290.0060.02716.32
5.5.280.0100.01816.57
5.5.270.0040.02116.37
5.5.260.0080.01916.46
5.5.250.0010.02316.45
5.5.240.0060.03116.27
5.5.230.0070.03216.30
5.5.220.0020.02616.23
5.5.210.0040.01916.20
5.5.200.0050.02816.24
5.5.190.0090.02816.19
5.5.180.0070.02716.31
5.5.170.0040.01214.25
5.5.160.0090.03016.26
5.5.150.0080.02816.30
5.5.140.0030.03316.24
5.5.130.0060.03216.33
5.5.120.0100.02916.14
5.5.110.0070.02716.36
5.5.100.0060.03116.11
5.5.90.0060.03016.03
5.5.80.0030.03616.23
5.5.70.0040.03216.39
5.5.60.0080.02216.21
5.5.50.0050.01816.27
5.5.40.0060.03516.15
5.5.30.0090.02916.10
5.5.20.0050.03316.18
5.5.10.0040.04016.28
5.5.00.0080.03016.20
5.4.450.0040.03214.45
5.4.440.0050.03014.54
5.4.430.0090.02714.52
5.4.420.0020.03414.54
5.4.410.0050.02614.58
5.4.400.0050.03014.38
5.4.390.0060.02214.50
5.4.380.0070.01814.48
5.4.370.0070.01614.32
5.4.360.0030.02414.41
5.4.350.0030.03014.46
5.4.340.0060.03014.39
5.4.330.0040.00712.13
5.4.320.0060.02514.45
5.4.310.0030.03114.32
5.4.300.0020.03014.42
5.4.290.0030.02514.40
5.4.280.0090.02814.47
5.4.270.0040.02914.44
5.4.260.0070.02914.44
5.4.250.0040.03114.50
5.4.240.0060.02514.37
5.4.230.0040.02914.43
5.4.220.0040.03214.38
5.4.210.0020.01814.37
5.4.200.0040.03114.44
5.4.190.0060.03014.53
5.4.180.0030.03314.39
5.4.170.0060.02014.43
5.4.160.0050.02914.42
5.4.150.0030.02914.46
5.4.140.0060.03013.43
5.4.130.0060.02713.61
5.4.120.0030.03313.53
5.4.110.0080.02413.45
5.4.100.0080.02713.63
5.4.90.0020.03113.57
5.4.80.0070.01613.45
5.4.70.0020.02113.53
5.4.60.0080.02413.39
5.4.50.0050.02913.52
5.4.40.0050.02413.53
5.4.30.0080.02413.49
5.4.20.0060.02513.57
5.4.10.0020.02813.50
5.4.00.0030.02713.37
5.3.290.0090.02212.90
5.3.280.0060.02712.87
5.3.270.0060.02812.89
5.3.260.0070.02912.90
5.3.250.0160.01912.79
5.3.240.0090.02712.85
5.3.230.0100.02612.86
5.3.220.0040.02712.82
5.3.210.0030.03212.80
5.3.200.0090.02412.72
5.3.190.0060.02612.84
5.3.180.0050.03012.88
5.3.170.0070.02912.81
5.3.160.0050.02812.79
5.3.150.0050.03012.91
5.3.140.0040.02212.79
5.3.130.0110.02212.88
5.3.120.0040.03212.80
5.3.110.0070.02812.79
5.3.100.0040.03112.77
5.3.90.0070.02912.88
5.3.80.0040.02512.82
5.3.70.0070.02612.82
5.3.60.0100.02712.86
5.3.50.0030.02212.87
5.3.40.0070.02412.78
5.3.30.0100.02612.87
5.3.20.0050.02912.75
5.3.10.0030.03012.69
5.3.00.0040.02412.69
5.2.170.0030.05314.84
5.2.160.0070.05714.84
5.2.150.0070.06714.84
5.2.140.0030.06714.84
5.2.130.0000.06714.84
5.2.120.0070.06014.84
5.2.110.0130.05014.84
5.2.100.0070.06314.84
5.2.90.0070.06714.84
5.2.80.0100.06014.84
5.2.70.0030.06014.84
5.2.60.0130.05714.84
5.2.50.0070.05714.84
5.2.40.0100.06014.84
5.2.30.0030.06314.84
5.2.20.0070.05714.84
5.2.10.0030.06714.84
5.2.00.0030.06014.84
5.1.60.0100.04714.84
5.1.50.0000.03014.84
5.1.40.0070.04314.84
5.1.30.0030.04714.84
5.1.20.0030.03714.84
5.1.10.0070.05014.84
5.1.00.0030.03014.84
5.0.50.0030.05014.84
5.0.40.0070.04014.84
5.0.30.0100.04714.84
5.0.20.0000.04714.84
5.0.10.0030.04314.84
5.0.00.0030.06014.84
4.4.90.0000.03314.84
4.4.80.0000.04014.84
4.4.70.0000.03714.84
4.4.60.0070.03014.84
4.4.50.0030.03714.84
4.4.40.0000.04014.84
4.4.30.0030.02314.84
4.4.20.0030.03314.84
4.4.10.0070.03314.84
4.4.00.0030.02314.84
4.3.110.0030.01014.84
4.3.100.0000.03714.84
4.3.90.0030.03314.84
4.3.80.0000.05714.84
4.3.70.0000.03714.84
4.3.60.0030.03014.84
4.3.50.0000.03714.84
4.3.40.0070.03314.84
4.3.30.0030.03714.84
4.3.20.0030.03714.84
4.3.10.0000.04014.84
4.3.00.0030.03014.84

preferences:
37.06 ms | 401 KiB | 5 Q