<?php
var mixed = array(
3,
3.4889211135,
3,88903098292,
"3",
"3.4889211135",
"3,88903098292",
0,
"0",
false,
"false",
true,
null,
"?",
"1.000,31",
"1,000.31",
"1,000.31",
"1.000,31 USD",
);
foreach ($mixed as $value) {
printf("`var_dump( %s )` gives:" . PHP_EOL, $value);
var_dump($value);
printf("`var_dump( intval(%s) )` gives:" . PHP_EOL, $value);
var_dump(@intval($value));
printf("`var_dump( (int)%s )` gives:" . PHP_EOL, $value);
var_dump(@intval($value));
print "---------------------------------" . PHP_EOL;
}
- Output for 5.4.0 - 5.4.23
- Parse error: syntax error, unexpected 'var' (T_VAR) in /in/W47c7 on line 2
Process exited with code 255. - Output for 5.3.0 - 5.3.28
- Parse error: syntax error, unexpected T_VAR in /in/W47c7 on line 2
Process exited with code 255.
preferences:
184.03 ms | 1395 KiB | 60 Q