3v4l.org

run code in 300+ PHP versions simultaneously
<?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());
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
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.
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
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.

preferences:
211.39 ms | 401 KiB | 291 Q