I agree with the consensus that it is bad to change the type (or even the meaning) of the return value.
Here is an illustration of how bad it will be:
, , "Writer":
function printThroughWriter(String $text, Writer $writer) {
$count = $writer->write($text);
print "Writer '".get_class($writer)."' printed $count characters.";
}
"Writer":
class Writer {
public function write(String $text) {
print $text;
return strlen($text);
}
}
, "LazyWriter" :
class LazyWriter extends Writer {
public function write(String $text) {
return true;
}
}
, Writer::write() - printThroughWriter, , .