3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class a { function boolean(boolean $t) : boolean { return $t; } } $a = new a(); $a->boolean(true); //boolean(true);
based on HpSZO
Output for 7.3.0alpha1 - 7.3.0beta1
Fatal error: Uncaught TypeError: Argument 1 passed to a::boolean() must be an instance of boolean, bool given, called in /in/OmqEf on line 11 and defined in /in/OmqEf:5 Stack trace: #0 /in/OmqEf(11): a->boolean(true) #1 {main} thrown in /in/OmqEf on line 5
Process exited with code 255.
Output for 7.0.0 - 7.2.6
Fatal error: Uncaught TypeError: Argument 1 passed to a::boolean() must be an instance of boolean, boolean given, called in /in/OmqEf on line 11 and defined in /in/OmqEf:5 Stack trace: #0 /in/OmqEf(11): a->boolean(true) #1 {main} thrown in /in/OmqEf on line 5
Process exited with code 255.
Output for 5.6.0 - 5.6.25
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/OmqEf on line 5
Process exited with code 255.