3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Assert { public static function isString($value) : string { if (false === is_string($value)) { throw new Exception('Not string.'); } return __CLASS__; } public static function notEmptyString($value) : string { if ('' === trim($value)) { throw new DomainException('Empty string.'); } return __CLASS__; } } $string = 'test'; $emptyString = ' '; Assert::isString($string)::notEmptyString($string); Assert::isString($emptyString)::notEmptyString($emptyString);

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)
8.5.60.0140.00417.04
8.5.50.0140.00316.94
8.5.30.0110.00719.62
8.5.20.0130.00620.19
8.5.10.0030.00520.27
8.5.00.0140.00720.15
8.4.180.0160.00523.88
8.4.170.0100.01122.18
8.4.160.0140.00925.80
8.4.150.0090.00416.93
8.4.140.0100.01217.77
8.4.130.0060.00418.04
8.4.120.0060.00620.52
8.4.110.0150.00522.38
8.4.100.0120.00918.03
8.4.90.0140.00418.63
8.4.80.0050.00417.93
8.4.70.0120.00818.10
8.4.60.0080.01320.43
8.4.50.0130.00717.73
8.4.40.0030.00520.50
8.4.30.0040.00420.68
8.4.20.0070.01419.48
8.4.10.0060.00923.99
8.3.300.0160.00720.52
8.3.290.0120.00720.82
8.3.280.0100.01218.46
8.3.270.0120.00816.47
8.3.260.0070.00316.69
8.3.250.0110.00819.11
8.3.240.0130.00616.62
8.3.230.0050.00416.89
8.3.220.0100.00017.11
8.3.210.0050.00316.78
8.3.200.0030.00616.65
8.3.190.0030.00417.01
8.3.180.0030.00518.49
8.3.170.0090.00916.93
8.3.160.0120.00616.63
8.3.150.0140.00418.83
8.3.140.0090.00916.75
8.3.130.0080.00818.71
8.3.120.0080.00020.66
8.3.110.0030.00620.94
8.3.100.0030.01020.39
8.3.90.0080.00026.77
8.3.80.0100.00019.36
8.3.70.0130.00718.56
8.3.60.0120.00316.75
8.3.50.0070.00716.50
8.3.40.0090.00920.17
8.3.30.0140.00018.80
8.3.20.0040.00424.18
8.3.10.0000.00724.66
8.3.00.0030.00526.16
8.2.300.0130.00718.71
8.2.290.0050.00620.41
8.2.280.0140.00818.75
8.2.270.0120.00816.84
8.2.260.0130.00319.13
8.2.250.0050.00316.80
8.2.240.0080.01118.65
8.2.230.0050.00522.58
8.2.220.0000.00924.06
8.2.210.0070.01126.77
8.2.200.0040.00418.88
8.2.190.0110.00718.66
8.2.180.0100.01016.75
8.2.170.0060.01218.91
8.2.160.0070.00722.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0040.00426.16
8.2.110.0030.00620.98
8.2.100.0070.00417.84
8.2.90.0000.00818.09
8.2.80.0030.00618.21
8.2.70.0080.00017.38
8.2.60.0050.00317.50
8.2.50.0090.00017.63
8.2.40.0100.00417.62
8.2.30.0060.00917.62
8.2.20.0100.00517.63
8.2.10.0090.00917.62
8.2.00.0120.00317.73
8.1.340.0160.00617.86
8.1.330.0100.00822.05
8.1.320.0100.00916.06
8.1.310.0080.00016.79
8.1.300.0120.00616.08
8.1.290.0090.00030.84
8.1.280.0100.00725.92
8.1.270.0040.00424.66
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00623.97
8.1.230.0040.00720.88
8.1.220.0060.00317.91
8.1.210.0030.00518.77
8.1.200.0030.00517.48
8.1.190.0040.00417.22
8.1.180.0030.00518.10
8.1.170.0100.00517.62
8.1.160.0100.00717.62
8.1.150.0120.00417.62
8.1.140.0140.00217.62
8.1.130.0150.00417.62
8.1.120.0170.00017.62
8.1.110.0110.00617.62
8.1.100.0170.00017.62
8.1.90.0090.00617.62
8.1.80.0130.00317.62
8.1.70.0150.00317.62
8.1.60.0110.00717.62
8.1.50.0120.00517.62
8.1.40.0110.00617.62
8.1.30.0140.00417.62
8.1.20.0160.00317.62
8.1.10.0140.00617.62
8.1.00.0130.00417.62
8.0.300.0060.00319.97
8.0.290.0040.00416.75
8.0.280.0150.00017.62
8.0.270.0130.00317.62
8.0.260.0170.00417.62
8.0.250.0170.00017.62
8.0.240.0110.00617.62
8.0.230.0100.00517.62
8.0.220.0130.00417.62
8.0.210.0120.00417.62
8.0.200.0110.00717.62
8.0.190.0160.00017.62
8.0.180.0120.00417.62
8.0.170.0120.00617.62
8.0.160.0060.01117.62
8.0.150.0160.00017.62
8.0.140.0140.00317.62
8.0.130.0130.00317.62
8.0.120.0080.01017.62
8.0.110.0080.00817.62
8.0.100.0110.00617.62
8.0.90.0080.00817.62
8.0.80.0090.00717.62
8.0.70.0130.00317.62
8.0.60.0150.00017.62
8.0.50.0120.00417.62
8.0.30.0150.00317.62
8.0.20.0150.00017.62
8.0.10.0140.00417.62

preferences:
91.13 ms | 1133 KiB | 5 Q