3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php declare(strict_types=0); function foo(int $i) {} foo(new stdclass);
based on rpCCR
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Argument 1 passed to foo() must be of the type integer, object given, called in /in/7P4YO on line 6 and defined in /in/7P4YO:4 Stack trace: #0 /in/7P4YO(6): foo(Object(stdClass)) #1 {main} thrown in /in/7P4YO on line 4
Process exited with code 255.
Output for 5.3.18 - 5.6.28
Warning: Unsupported declare 'strict_types' in /in/7P4YO on line 2 Catchable fatal error: Argument 1 passed to foo() must be an instance of int, instance of stdClass given, called in /in/7P4YO on line 6 and defined in /in/7P4YO on line 4
Process exited with code 255.