mlse
07-22-2007, 02:28 PM
Hi all,
I am running PHP 5.2.
check out the following code:
function foo(integer $arg)
{
echo $arg."\n";
}
$num = 1;
try
{
foo($num);
}
catch (Exception $e)
{
echo $e->getmessage()."\n";
}
Perfectly resonable, you might say ... but when I run it, I get the following error:
Catchable fatal error: Argument 1 passed to foo() must be an instance of integer, integer given, called in /***/test.php on line 12 and defined in /***/test.php on line 3
:confused: :confused: :confused:
Incidentally it works fine when I strictly type the function argument to be an object - it just doesn't seem to like non-object types or references ....
I am running PHP 5.2.
check out the following code:
function foo(integer $arg)
{
echo $arg."\n";
}
$num = 1;
try
{
foo($num);
}
catch (Exception $e)
{
echo $e->getmessage()."\n";
}
Perfectly resonable, you might say ... but when I run it, I get the following error:
Catchable fatal error: Argument 1 passed to foo() must be an instance of integer, integer given, called in /***/test.php on line 12 and defined in /***/test.php on line 3
:confused: :confused: :confused:
Incidentally it works fine when I strictly type the function argument to be an object - it just doesn't seem to like non-object types or references ....