3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php declare(strict_types = 1); function strictInt(int &$i) { $i = new stdClass; } $i = 42; strictInt($i); var_dump($i);
Output for 7.0.0 - 7.2.0
object(stdClass)#1 (0) { }
Output for 5.3.18 - 5.6.28
Warning: Unsupported declare 'strict_types' in /in/RWI7a on line 3 Catchable fatal error: Argument 1 passed to strictInt() must be an instance of int, integer given, called in /in/RWI7a on line 12 and defined in /in/RWI7a on line 5
Process exited with code 255.