3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); error_reporting(0); ini_set('display_errors', '0'); set_exception_handler(function($e) { die(get_class($e)); }); function foo(int $x): void { var_dump($x); exit; } foo(3 . 7 + 5);
Output for 8.0.0 - 8.0.3
TypeError
Output for 7.4.0 - 7.4.13
Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /in/2Wnsf on line 16 int(42)
Output for 7.2.0 - 7.2.34, 7.3.0 - 7.3.26
int(42)