3v4l.org

run code in 300+ PHP versions simultaneously
<?php class HelloWorld { public function sayHello($mixed): void { if (ctype_digit((string) $mixed)) { var_dump($mixed); } if (ctype_digit((int) $mixed)) { var_dump($mixed); } } } $h = new HelloWorld(); $h->sayHello(4);
Output for 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
int(4) Deprecated: ctype_digit(): Argument of type int will be interpreted as string in the future in /in/LPe72 on line 10
Output for 8.0.1 - 8.0.30
int(4)

preferences:
97.09 ms | 407 KiB | 5 Q