3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php declare(strict_types = 1); function add(int $a, int $b) { return $a + $b; } echo(add(2, 5));
based on plZ7Y
Output for 7.0.0 - 7.2.0
7
Output for 5.3.20 - 5.6.28
Warning: Unsupported declare 'strict_types' in /in/R4S2D on line 3 Catchable fatal error: Argument 1 passed to add() must be an instance of int, integer given, called in /in/R4S2D on line 8 and defined in /in/R4S2D on line 5
Process exited with code 255.