<?php
// declare(strict_types=1); # Rimuovi il commento per vedere cosa accade dichiarando i tipi come strict
function printIntValue(int $value)
{
var_dump($value);
}
printIntValue(5.9);
Deprecated: Implicit conversion from float 5.9 to int loses precision in /in/bp1Xt on line 5
int(5)
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Deprecated: Implicit conversion from float 5.9 to int loses precision in /in/bp1Xt on line 5
int(5)
Catchable fatal error: Argument 1 passed to printIntValue() must be an instance of int, double given, called in /in/bp1Xt on line 10 and defined in /in/bp1Xt on line 5
Process exited with code 255.
Output for 5.1.0 - 5.1.6
Fatal error: Argument 1 passed to printIntValue() must be an object of class int, called in /in/bp1Xt on line 10 and defined in /in/bp1Xt on line 5
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Argument 1 must be an object of class int in /in/bp1Xt on line 5
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting ')' in /in/bp1Xt on line 5
Process exited with code 255.