3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php declare(strict_types=1); class Filter { // A constructor in PHP 4 and 5 function __construct(int $a) { echo $a; } } try { $o1 = new Filter(5); $o2 = new Filter('5'); } catch (Error $e) { echo "Exception propre: {$e->getMessage()}\n"; }
based on iYBqr
Output for 7.0.0 - 7.2.0
5Exception propre: Argument 1 passed to Filter::__construct() must be of the type integer, string given, called in /in/eJufv on line 13
Output for 5.3.19 - 5.6.28
Warning: Unsupported declare 'strict_types' in /in/eJufv on line 2 Catchable fatal error: Argument 1 passed to Filter::__construct() must be an instance of int, integer given, called in /in/eJufv on line 12 and defined in /in/eJufv on line 7
Process exited with code 255.