3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Filter { // A constructor in PHP 4 and 5 function __construct(int $a) { echo $a; } } $o1 = new Filter(5); $o2 = new Filter('a');
based on DrUWp
Output for 7.0.0 - 7.2.0
5 Fatal error: Uncaught TypeError: Argument 1 passed to Filter::__construct() must be of the type integer, string given, called in /in/HR4cS on line 11 and defined in /in/HR4cS:5 Stack trace: #0 /in/HR4cS(11): Filter->__construct('a') #1 {main} thrown in /in/HR4cS on line 5
Process exited with code 255.
Output for 5.3.19 - 5.6.28
Catchable fatal error: Argument 1 passed to Filter::__construct() must be an instance of int, integer given, called in /in/HR4cS on line 10 and defined in /in/HR4cS on line 5
Process exited with code 255.