3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "intval \t integer casting". PHP_EOL; echo intval(42) ."\t". (int)42 . PHP_EOL; echo intval(4.2) ."\t". (int)(4.2) . PHP_EOL; echo intval('42') ."\t". (int)('42') . PHP_EOL; echo intval('+42') ."\t". (int)('+42') . PHP_EOL; echo intval('-42') ."\t". (int)('-42') . PHP_EOL; echo intval(042) ."\t". (int)(042) . PHP_EOL; echo intval('042') ."\t". (int)('042') . PHP_EOL; echo intval(1e10) ."\t". (int)(1e10) . PHP_EOL; echo intval('1e10') ."\t". (int)('1e10') . PHP_EOL; echo intval(0x1A) ."\t". (int)(0x1A) . PHP_EOL; echo intval(42000000) ."\t". (int)(42000000) . PHP_EOL; echo intval(420000000000000000000) ."\t". (int)(420000000000000000000) . PHP_EOL; echo intval('420000000000000000000') ."\t". (int)('420000000000000000000') . PHP_EOL; echo intval(array()) ."\t". (int)(array()) . PHP_EOL; echo intval(array('foo', 'bar')) ."\t". (int)(array('foo', 'bar')) . PHP_EOL; echo intval(false) ."\t". (int)(false) . PHP_EOL; echo intval(true) ."\t". (int)(true) . PHP_EOL;

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.10.0160.00321.88
8.3.140.0110.00416.70
8.3.130.0040.00416.74
8.3.120.0030.00619.00
8.3.110.0000.00920.94
8.3.100.0060.00624.06
8.3.90.0110.00726.77
8.3.80.0100.00018.45
8.3.70.0110.00716.75
8.3.60.0000.01516.75
8.3.50.0160.00020.14
8.3.40.0070.01021.76
8.3.30.0130.00918.79
8.3.20.0070.00024.18
8.3.10.0050.00324.66
8.3.00.0040.00426.16
8.2.250.0130.00618.24
8.2.240.0000.00817.05
8.2.230.0060.00322.58
8.2.220.0060.00337.54
8.2.210.0050.00326.77
8.2.200.0060.00316.63
8.2.190.0070.01118.38
8.2.180.0170.00325.92
8.2.170.0070.00719.04
8.2.160.0110.00422.96
8.2.150.0080.00025.66
8.2.140.0070.00024.66
8.2.130.0040.00426.16
8.2.120.0070.00020.99
8.2.110.0060.00322.20
8.2.100.0080.00417.91
8.2.90.0000.00818.03
8.2.80.0000.00819.07
8.2.70.0030.00517.63
8.2.60.0040.00417.63
8.2.50.0050.00317.75
8.2.40.0080.00018.16
8.2.30.0030.00517.97
8.2.20.0020.00519.21
8.2.10.0000.00718.01
8.2.00.0040.00419.09
8.1.300.0090.00018.62
8.1.290.0060.00630.84
8.1.280.0120.00625.92
8.1.270.0040.00423.84
8.1.260.0040.00426.35
8.1.250.0060.00328.09
8.1.240.0030.00617.36
8.1.230.0120.00022.59
8.1.220.0000.00817.79
8.1.210.0030.00618.77
8.1.200.0030.00517.35
8.1.190.0090.00017.11
8.1.180.0000.00918.10
8.1.170.0000.00918.71
8.1.160.0060.00318.96
8.1.150.0040.00418.68
8.1.140.0030.00717.46
8.1.130.0000.00719.01
8.1.120.0000.00717.55
8.1.110.0040.00417.50
8.1.100.0070.00017.55
8.1.90.0140.00217.42
8.1.80.0120.00317.32
8.1.70.0080.00717.48
8.1.60.0160.00317.54
8.1.50.0140.00417.50
8.1.40.0190.00017.57
8.1.30.0130.00617.66
8.1.20.0190.00017.58
8.1.10.0120.00617.53
8.1.00.0090.00917.41
8.0.300.0000.00719.98
8.0.290.0040.00416.88
8.0.280.0000.00818.41
8.0.270.0040.00418.14
8.0.260.0030.00318.52
8.0.250.0070.00016.97
8.0.240.0000.00616.97
8.0.230.0070.00017.05
8.0.220.0050.00916.89
8.0.210.0070.00716.83
8.0.200.0140.00016.97
8.0.190.0130.00317.04
8.0.180.0100.00516.97
8.0.170.0070.00716.99
8.0.160.0070.00716.98
8.0.150.0050.00916.75
8.0.140.0080.00416.99
8.0.130.0150.00016.81
8.0.120.0120.00216.89
8.0.110.0180.00016.82
8.0.100.0160.00016.89
8.0.90.0080.00816.88
8.0.80.0100.00617.00
8.0.70.0070.00716.95
8.0.60.0140.00016.88
8.0.50.0100.00516.98
8.0.30.0140.00016.96
8.0.20.0100.00516.96
8.0.10.0110.00417.02
7.4.330.0000.00515.55
7.4.320.0030.00316.70
7.4.300.0100.00316.56
7.4.290.0170.00016.66
7.4.280.0120.00216.63
7.4.270.0140.00016.59
7.4.260.0080.00816.41
7.4.250.0110.00516.38
7.4.240.0050.01116.54
7.4.230.0070.00716.52
7.4.220.0060.00816.55
7.4.210.0100.00516.35
7.4.200.0150.00016.57
7.4.190.0120.00316.59
7.4.180.0140.00016.54
7.4.160.0110.00316.59
7.4.150.0130.00016.43
7.4.140.0140.00016.30
7.4.130.0090.00516.46
7.4.120.0130.00016.43
7.4.110.0060.00916.39
7.4.100.0130.00016.38
7.4.90.0120.00016.40
7.4.80.0050.00816.47
7.4.70.0070.00416.42
7.4.60.0110.00016.29
7.4.50.0060.00616.33
7.4.40.0030.00716.31
7.4.30.0100.00216.40
7.4.20.0100.00316.43
7.4.10.0070.00516.22
7.4.00.0100.00016.41
5.5.380.0070.00416.52

preferences:
28.51 ms | 403 KiB | 5 Q