3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); function setAge(int $age) { var_dump($age); } // First test is clearly wrong // setAge("totally not an int"); <-- Fatal error expected int found string // Try passing something like this setAge("30+1"); // What about this? setAge("30"); // Finally a real int :) setAge(30); // U jelly? setAge(.1);

preferences:
44.55 ms | 402 KiB | 5 Q