3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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());
based on 00IY5
Output for 7.0.0 - 7.3.0beta1
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.26
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.