And if the reason for the "return value" is that it can't construct a legitimate object for some reason, the appropriate thing to do is to throw an exception.
Of course, all this is pretty much moot. Constructors don't return values:
<?php
class foo
{
function __construct($bar)
{
if($bar!=42) throw new Exception("FORTY-TWO");
return 'Fnord';
}
}
try
{
$t = new foo(42);
echo get_class($t),"\n";
}
catch(Exception $e)
{
echo "Couldn't create \$t - the constructor said: ",$e->getMessage(),"\n";
}
try
{
$u = new foo(17);
echo get_class($u),"\n";
}
catch(Exception $e)
{
echo "Couldn't create \$u - the constructor said: ",$e->getMessage(),"\n";
}
$booboo = foo();
echo $booboo;