PHP 7 - Why does a method that returns the String primitive does not generate an error returning a Boolean value?
<?php
class Foo
{
public function bar() : string
{
return true;
}
}
$Foo = new Foo();
echo $Foo->bar();
?>
Output: 1