<?php
class Test {
private $booleanWert;
public function setBooleanWert(boolean $booleanWert) {
$this->booleanWert = $booleanWert;
}
public function getBooleanWert() {
return $this->booleanWert;
}
}
$t = new Test();
$t->setBooleanWert("Ola");
echo($t->getBooleanWert());
Warning: "boolean" will be interpreted as a class name. Did you mean "bool"? Write "\boolean" to suppress this warning in /in/j0bSf on line 6
Fatal error: Uncaught TypeError: Test::setBooleanWert(): Argument #1 ($booleanWert) must be of type boolean, string given, called in /in/j0bSf on line 17 and defined in /in/j0bSf:6
Stack trace:
#0 /in/j0bSf(17): Test->setBooleanWert('Ola')
#1 {main}
thrown in /in/j0bSf on line 6
Process exited with code 255.
Fatal error: Uncaught TypeError: Argument 1 passed to Test::setBooleanWert() must be an instance of boolean, string given, called in /in/j0bSf on line 17 and defined in /in/j0bSf:6
Stack trace:
#0 /in/j0bSf(17): Test->setBooleanWert('Ola')
#1 {main}
thrown in /in/j0bSf on line 6
Process exited with code 255.
Output for 5.6.0 - 5.6.40
Catchable fatal error: Argument 1 passed to Test::setBooleanWert() must be an instance of boolean, string given, called in /in/j0bSf on line 17 and defined in /in/j0bSf on line 6
Process exited with code 255.