3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private int $number = 5; public function getNumber(): int { return $this->number; } } $fieldName = "number"; $fieldNameFirstChar = mb_strtoupper(mb_substr($fieldName, 0, 1)); $fieldNameLastChars = mb_substr($fieldName, 1); $fieldName = "get" . $fieldNameFirstChar . $fieldNameLastChars; $test = new Test(); print_r($test->$fieldName());

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.4.120.0120.00820.24
8.4.110.0030.00522.53
8.4.100.0070.00418.59
8.4.90.0070.01218.98
8.4.80.0140.00717.89
8.4.70.0050.00318.04
8.4.60.0090.00618.87
8.4.50.0140.00618.95
8.4.40.0000.00917.59
8.4.30.0150.00318.68
8.4.20.0040.00418.88
8.4.10.0110.00019.28
8.3.250.0060.00218.75
8.3.240.0120.00817.05
8.3.230.0110.00816.65
8.3.220.0100.00818.95
8.3.210.0090.01016.60
8.3.200.0050.00416.34
8.3.190.0140.00516.75
8.3.180.0100.00916.57
8.3.170.0030.00718.73
8.3.160.0110.00716.74
8.3.150.0120.00618.87
8.3.140.0080.00019.18
8.3.130.0040.00418.25
8.3.120.0100.00618.89
8.3.110.0060.00320.94
8.3.100.0030.00624.06
8.3.90.0080.00026.77
8.3.80.0060.00318.30
8.3.70.0090.00616.59
8.3.60.0090.00616.75
8.3.50.0120.00316.46
8.3.40.0160.00320.35
8.3.30.0080.00620.34
8.3.20.0040.00424.18
8.3.10.0110.00724.66
8.3.00.0100.01024.66
8.2.290.0120.00620.63
8.2.280.0110.00718.60
8.2.270.0070.01019.20
8.2.260.0040.01116.56
8.2.250.0030.00616.66
8.2.240.0090.00018.88
8.2.230.0060.00322.58
8.2.220.0030.00637.54
8.2.210.0030.00526.77
8.2.200.0040.00416.50
8.2.190.0030.01316.74
8.2.180.0140.00425.92
8.2.170.0070.00718.85
8.2.160.0150.00622.96
8.2.150.0000.00825.66
8.2.140.0140.00424.66
8.2.130.0070.01124.66
8.2.120.0100.00624.66
8.2.110.0130.00324.66
8.2.100.0070.01424.66
8.2.90.0100.01024.66
8.2.80.0090.00624.66
8.2.70.0110.00424.66
8.2.60.0140.00724.66
8.2.50.0140.00624.66
8.2.40.0040.01224.66
8.2.30.0100.01024.66
8.2.20.0100.00624.66
8.2.10.0060.01024.66
8.2.00.0000.01324.66
8.1.330.0130.00522.08
8.1.320.0120.00816.16
8.1.310.0000.00815.94
8.1.300.0030.00620.34
8.1.290.0050.00530.84
8.1.280.0060.01225.92
8.1.270.0100.00724.66
8.1.260.0100.00724.66
8.1.250.0070.01024.66
8.1.240.0100.00624.66
8.1.230.0090.00624.66
8.1.220.0030.00524.66
8.1.210.0030.00624.66
8.1.200.0040.00424.66
8.1.190.0040.00424.66
8.1.180.0000.00824.66
8.1.170.0080.00024.66
8.1.160.0060.00324.66
8.1.150.0040.00424.66
8.1.140.0080.00024.66
8.1.130.0040.00424.66
8.1.120.0080.00024.66
8.1.110.0080.00024.66
8.1.100.0050.00324.66
8.1.90.0060.00324.66
8.1.80.0080.00024.66
8.1.70.0030.00624.66
8.1.60.0090.00024.66
8.1.50.0090.00024.66
8.1.40.0030.00624.66
8.1.30.0040.00424.66
8.1.20.0080.00024.66
8.1.10.0080.00024.66
8.1.00.0040.00424.66

preferences:
27.27 ms | 403 KiB | 5 Q