3v4l.org

run code in 300+ PHP versions simultaneously
<?php $battery = "280"; $voltage_full = 320; // old hardware 100; $voltage_empty = 240; // old hardware 75; $voltage_range = $voltage_full - $voltage_empty; $battery_range = $battery – $voltage_empty; $battery = (int) $battery; if ( $battery >= $voltage_full ){ $battery_percentage = 100; } else { if ( $battery <= 240 ) { $battery_percentage = 0; } else { $battery_percentage = (100 * ($battery_range / $voltage_range)); } }

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)
5.4.280.0070.03412.39
5.4.270.0070.03512.36
5.4.260.0070.03612.36
5.4.250.0030.04012.36
5.4.240.0050.03712.36
5.4.230.0110.03212.35
5.4.220.0040.03712.35
5.4.210.0050.03612.36
5.4.200.0060.04012.36
5.4.190.0090.03512.35
5.4.180.0050.04112.35
5.4.170.0060.05112.36
5.4.160.0060.03512.35
5.4.150.0050.03812.35
5.4.140.0050.03812.04
5.4.130.0030.03912.02
5.4.120.0060.03511.98
5.4.110.0060.03511.98
5.4.100.0030.03811.98
5.4.90.0030.04011.98
5.4.80.0040.03811.98
5.4.70.0060.03411.98
5.4.60.0060.03411.98
5.4.50.0060.03611.98
5.4.40.0070.03411.96
5.4.30.0070.03411.96
5.4.20.0040.03811.95
5.4.10.0010.03911.96
5.4.00.0050.03911.45
5.3.280.0060.03712.71
5.3.270.0050.04012.72
5.3.260.0080.03712.72
5.3.250.0090.03412.72
5.3.240.0040.04012.72
5.3.230.0040.04012.71
5.3.220.0060.03712.68
5.3.210.0040.04112.68
5.3.200.0060.03712.68
5.3.190.0040.04112.68
5.3.180.0050.03912.67
5.3.170.0090.04112.67
5.3.160.0050.03912.67
5.3.150.0040.03912.68
5.3.140.0050.03712.66
5.3.130.0100.03512.65
5.3.120.0050.03912.66
5.3.110.0050.03912.66
5.3.100.0060.03612.12
5.3.90.0070.03512.08
5.3.80.0070.03612.07
5.3.70.0060.04612.08
5.3.60.0050.03712.07
5.3.50.0070.03912.00
5.3.40.0080.03912.00
5.3.30.0100.03611.94
5.3.20.0080.03611.70
5.3.10.0040.03711.66
5.3.00.0060.03611.65

preferences:
139.52 ms | 1394 KiB | 7 Q