3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); class TheClass { /** @var int */ public $seven = 7; public function getFive(): int { return 5; } public static function getSevenStrangelyButSafely(?TheClass $object): int { return $object->seven ?? 7; } public static function getFiveUnsafely(?TheClass $object): int { return $object->getFive() ?? 5; } } $value = TheClass::getSevenStrangelyButSafely(null); $value = TheClass::getFiveUnsafely(null);

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.3.60.0100.01018.43
8.3.50.0040.01116.25
8.3.40.0150.00418.79
8.3.30.0040.01118.71
8.3.20.0040.00421.87
8.3.10.0000.00823.54
8.3.00.0080.00021.24
8.2.180.0040.01216.75
8.2.170.0100.00722.96
8.2.160.0100.00722.31
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0050.00220.35
8.2.120.0030.00526.35
8.2.110.0040.00420.87
8.2.100.0080.00317.78
8.2.90.0030.00518.09
8.2.80.0050.00318.09
8.2.70.0060.00317.80
8.2.60.0000.00817.63
8.2.50.0000.01118.10
8.2.40.0040.00422.36
8.2.30.0040.00419.29
8.2.20.0000.00717.88
8.2.10.0040.00417.76
8.2.00.0040.00417.96
8.1.280.0110.00325.92
8.1.270.0000.00822.06
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0090.00022.54
8.1.230.0060.00622.68
8.1.220.0000.00817.74
8.1.210.0060.00318.77
8.1.200.0090.00017.35
8.1.190.0060.00317.13
8.1.180.0040.00418.10
8.1.170.0000.00818.51
8.1.160.0080.00018.82
8.1.150.0030.00420.25
8.1.140.0000.00717.64
8.1.130.0030.00618.99
8.1.120.0000.00717.43
8.1.110.0000.00817.32
8.1.100.0000.00717.35
8.1.90.0050.00317.47
8.1.80.0000.00717.39
8.1.70.0040.00417.45
8.1.60.0100.00017.63
8.1.50.0000.00917.55
8.1.40.0040.00417.48
8.1.30.0080.00017.55
8.1.20.0030.00517.58
8.1.10.0040.00417.56
8.1.00.0000.01017.49
8.0.300.0000.00719.82
8.0.290.0080.00016.75
8.0.280.0070.00018.38
8.0.270.0070.00017.20
8.0.260.0030.00616.80
8.0.250.0050.00316.93
8.0.240.0040.00416.94
8.0.230.0070.00017.01
8.0.220.0040.00416.86
8.0.210.0030.00316.80
8.0.200.0070.00016.85
8.0.190.0040.00416.92
8.0.180.0000.00716.96
8.0.170.0080.00016.74
8.0.160.0040.00416.91
8.0.150.0030.00316.86
8.0.140.0070.00016.79
8.0.130.0000.00613.34
8.0.120.0000.00716.87
8.0.110.0040.00416.93
8.0.100.0070.00016.81
8.0.90.0040.00416.77
8.0.80.0030.01416.88
8.0.70.0040.00416.84
8.0.60.0040.00416.89
8.0.50.0040.00416.76
8.0.30.0120.00817.13
8.0.20.0100.01017.40
8.0.10.0040.00416.82
8.0.00.0070.01216.59
7.4.330.0000.00615.55
7.4.320.0000.00716.47
7.4.300.0040.00416.63
7.4.290.0030.00316.61
7.4.280.0080.00316.45
7.4.270.0040.00416.51
7.4.260.0000.00716.57
7.4.250.0070.00016.55
7.4.240.0040.00416.54
7.4.230.0000.00716.63
7.4.220.0050.00316.41
7.4.210.0070.01016.63
7.4.200.0000.00816.46
7.4.160.0110.00516.52
7.4.140.0130.00617.86
7.4.130.0130.00916.55
7.4.120.0130.00516.54
7.4.110.0180.00016.65
7.4.100.0150.00316.56
7.4.90.0070.01116.57
7.4.80.0110.01319.39
7.4.70.0030.01316.68
7.4.60.0110.00516.38
7.4.50.0130.00316.66
7.4.40.0170.00016.61
7.4.00.0070.01214.90
7.3.330.0000.00513.36
7.3.320.0030.00313.14
7.3.310.0030.00316.36
7.3.300.0070.00016.37
7.3.290.0030.00316.24
7.3.280.0070.00716.38
7.3.260.0110.01416.49
7.3.240.0070.00816.32
7.3.230.0120.00616.39
7.3.210.0070.01016.54
7.3.200.0130.00316.36
7.3.190.0120.00816.57
7.3.180.0070.01016.29
7.3.170.0130.00316.39
7.3.160.0120.00316.39
7.3.120.0060.01314.82
7.3.110.0070.01014.59
7.3.100.0070.00714.40
7.3.90.0090.00615.01
7.3.80.0120.00314.84
7.3.70.0040.01214.85
7.3.60.0100.00314.65
7.3.50.0100.00314.50
7.3.40.0030.00714.68
7.3.30.0040.00814.73
7.3.20.0070.01016.48
7.3.10.0040.01116.61
7.3.00.0090.00716.39
7.2.330.0110.00716.78
7.2.320.0030.01416.57
7.2.310.0100.00616.59
7.2.300.0040.01316.62
7.2.290.0040.01716.28
7.2.250.0100.01015.20
7.2.240.0120.00614.89
7.2.230.0070.00714.95
7.2.220.0000.01115.12
7.2.210.0070.01115.12
7.2.200.0090.00614.91
7.2.190.0070.00714.90
7.2.180.0030.01214.96
7.2.170.0000.01414.97
7.2.130.0070.00316.44
7.2.120.0030.00716.32
7.2.110.0130.00516.35
7.2.100.0080.00516.68
7.2.90.0040.01116.90
7.2.80.0040.00816.48
7.2.70.0030.01016.75
7.2.60.0060.00816.72
7.2.50.0070.01016.54
7.2.40.0030.01316.87
7.2.30.0100.01317.20
7.2.20.0130.00917.40
7.2.10.0100.00817.18
7.2.00.0100.00817.06
7.1.330.0000.01515.79
7.1.320.0030.01115.77
7.1.310.0070.00415.63
7.1.300.0030.01015.32
7.1.290.0070.00315.43
7.1.280.0070.00415.53
7.1.270.0080.00815.48
7.1.260.0070.00715.43
7.1.250.0100.00715.53
7.1.200.0040.01115.87
7.1.150.0160.00916.31
7.1.140.0150.01216.36
7.1.130.0130.00916.62
7.1.120.0110.01116.74
7.1.110.0140.01515.90
7.1.100.0140.01116.09
7.1.90.0100.01215.79
7.1.80.0550.00815.71
7.1.70.0130.01015.07
7.1.60.0290.01433.13
7.1.50.0340.01332.94
7.1.40.0270.01232.38
7.1.30.0300.01132.58
7.1.20.0380.01732.81
7.1.10.0110.01314.73
7.1.00.0140.01314.78

preferences:
58.73 ms | 400 KiB | 5 Q