3v4l.org

run code in 300+ PHP versions simultaneously
<?php $int = 20060627; $typehint = function ($int): float { return $int * 10; }; $class = new class { function float($num): float { return $num * 10; } }; class Foo { public function getW($val): float { return $val * 10; } } var_dump(json_encode([(float)$int, $typehint($int), $class->float($int), (new Foo)->getW($int)])); echo floatval($int), PHP_EOL, $typehint($int);

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.70.0030.01618.40
8.3.60.0130.00718.43
8.3.50.0070.00718.01
8.3.40.0120.00618.66
8.3.30.0130.00318.66
8.3.20.0040.00419.21
8.3.10.0000.00823.53
8.3.00.0070.00020.75
8.2.190.0110.00416.65
8.2.180.0120.00318.29
8.2.170.0120.00322.96
8.2.160.0070.00720.47
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0050.00318.16
8.2.120.0000.00726.35
8.2.110.0060.00319.31
8.2.100.0090.00318.22
8.2.90.0000.00817.73
8.2.80.0040.00418.96
8.2.70.0060.00317.93
8.2.60.0050.00318.22
8.2.50.0030.00518.10
8.2.40.0040.00419.34
8.2.30.0050.00219.14
8.2.20.0030.00518.13
8.2.10.0000.00918.14
8.2.00.0050.00317.79
8.1.280.0140.00725.92
8.1.270.0080.00020.86
8.1.260.0080.00026.35
8.1.250.0000.00728.09
8.1.240.0060.00320.39
8.1.230.0080.00318.90
8.1.220.0000.00817.79
8.1.210.0060.00318.77
8.1.200.0040.00417.23
8.1.190.0080.00017.22
8.1.180.0050.00318.10
8.1.170.0060.00318.57
8.1.160.0040.00418.90
8.1.150.0040.00418.94
8.1.140.0000.00722.12
8.1.130.0030.00320.31
8.1.120.0050.00217.37
8.1.110.0040.00417.46
8.1.100.0040.00417.36
8.1.90.0040.00417.45
8.1.80.0040.00717.52
8.1.70.0040.00417.48
8.1.60.0040.00417.48
8.1.50.0000.00817.42
8.1.40.0040.00417.43
8.1.30.0040.00417.73
8.1.20.0070.00317.57
8.1.10.0030.00617.60
8.1.00.0030.00617.41
8.0.300.0000.00818.77
8.0.290.0040.00416.63
8.0.280.0030.00318.32
8.0.270.0070.00017.25
8.0.260.0000.00618.44
8.0.250.0050.00216.82
8.0.240.0000.00716.95
8.0.230.0030.00316.87
8.0.220.0000.00716.89
8.0.210.0080.00016.90
8.0.200.0030.00316.91
8.0.190.0040.00416.93
8.0.180.0040.00416.95
8.0.170.0040.00416.94
8.0.160.0000.00716.99
8.0.150.0000.00816.69
8.0.140.0000.00716.84
8.0.130.0060.00013.31
8.0.120.0000.00716.89
8.0.110.0000.00716.79
8.0.100.0040.00416.87
8.0.90.0070.00016.75
8.0.80.0050.01116.82
8.0.70.0040.00416.75
8.0.60.0040.00416.90
8.0.50.0030.00516.89
8.0.30.0130.00616.75
8.0.20.0030.01517.40
8.0.10.0040.00416.84
8.0.00.0120.00816.73
7.4.330.0050.00015.55
7.4.320.0000.00616.61
7.4.300.0040.00416.56
7.4.290.0050.00216.60
7.4.280.0020.00516.46
7.4.270.0000.00716.61
7.4.260.0030.00616.50
7.4.250.0040.00416.55
7.4.240.0060.00316.46
7.4.230.0030.00316.58
7.4.220.0040.00416.50
7.4.210.0130.00416.57
7.4.200.0040.00416.54
7.4.160.0080.00816.43
7.4.140.0090.01217.86
7.4.130.0110.01116.46
7.4.120.0080.01016.59
7.3.330.0000.00613.28
7.3.320.0000.00613.11
7.3.310.0040.00416.31
7.3.300.0030.00316.34
7.3.290.0030.00316.36
7.3.280.0130.00316.25
7.3.260.0110.00716.48
7.3.240.0070.01116.32
7.2.110.0830.00614.74

preferences:
51.76 ms | 401 KiB | 5 Q