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; } } 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.60.0120.00318.30
8.3.50.0080.00818.33
8.3.40.0120.00618.62
8.3.30.0070.00718.71
8.3.20.0080.00019.24
8.3.10.0080.00023.61
8.3.00.0070.00020.64
8.2.180.0070.01418.41
8.2.170.0090.00622.96
8.2.160.0070.00720.43
8.2.150.0080.00024.18
8.2.140.0090.00024.66
8.2.130.0040.00418.21
8.2.120.0040.00426.35
8.2.110.0040.00419.31
8.2.100.0100.00018.20
8.2.90.0000.00817.75
8.2.80.0080.00018.84
8.2.70.0050.00317.93
8.2.60.0000.00918.16
8.2.50.0000.00818.10
8.2.40.0040.00419.47
8.2.30.0040.00419.32
8.2.20.0000.00717.96
8.2.10.0040.00418.05
8.2.00.0030.00617.65
8.1.280.0140.00025.92
8.1.270.0040.00420.69
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0000.01120.30
8.1.230.0040.00818.92
8.1.220.0080.00017.74
8.1.210.0000.00818.77
8.1.200.0100.00017.23
8.1.190.0000.00817.35
8.1.180.0000.00818.10
8.1.170.0080.00018.46
8.1.160.0040.00418.77
8.1.150.0000.00818.90
8.1.140.0070.00022.16
8.1.130.0030.00320.28
8.1.120.0040.00417.43
8.1.110.0030.00617.41
8.1.100.0040.00417.42
8.1.90.0080.00017.36
8.1.80.0000.00917.49
8.1.70.0030.00317.46
8.1.60.0000.00817.47
8.1.50.0000.00817.42
8.1.40.0080.00017.50
8.1.30.0000.00817.50
8.1.20.0030.00517.61
8.1.10.0040.00417.61
8.1.00.0050.00317.45
8.0.300.0040.00418.77
8.0.290.0040.00416.60
8.0.280.0000.00718.51
8.0.270.0030.00317.27
8.0.260.0060.00018.49
8.0.250.0070.00016.84
8.0.240.0000.00616.91
8.0.230.0000.00816.94
8.0.220.0000.00716.91
8.0.210.0040.00416.83
8.0.200.0000.00717.00
8.0.190.0040.00416.92
8.0.180.0000.00816.96
8.0.170.0030.00516.96
8.0.160.0050.00316.87
8.0.150.0000.00716.92
8.0.140.0040.00416.81
8.0.130.0050.00013.28
8.0.120.0040.00416.76
8.0.110.0040.00516.75
8.0.100.0040.00416.77
8.0.90.0000.00716.77
8.0.80.0060.00816.82
8.0.70.0070.00016.78
8.0.60.0050.00216.79
8.0.50.0070.00016.72
8.0.30.0070.01117.27
8.0.20.0110.00717.40
8.0.10.0050.00316.96
8.0.00.0090.00916.75
7.4.330.0000.00515.55
7.4.320.0030.00316.61
7.4.300.0040.00416.58
7.4.290.0000.00716.52
7.4.280.0000.00716.63
7.4.270.0000.00716.65
7.4.260.0000.00916.46
7.4.250.0090.00016.48
7.4.240.0090.00016.46
7.4.230.0000.00716.67
7.4.220.0030.00516.46
7.4.210.0090.00516.65
7.4.200.0040.00416.64
7.4.160.0090.00916.58
7.4.140.0110.00917.86
7.4.130.0090.00916.66
7.4.120.0120.00616.44
7.3.330.0030.00313.28
7.3.320.0060.00013.16
7.3.310.0060.00316.34
7.3.300.0040.00416.31
7.3.290.0030.00316.23
7.3.280.0070.00716.32
7.3.260.0110.00816.48
7.3.240.0070.01016.25
7.2.110.0860.00614.75

preferences:
97.45 ms | 400 KiB | 5 Q