3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $foo = (int) 'foobar'; var_dump($foo); function int(int $foo) { var_dump($foo); } int('foobar');
based on JL0qH
Output for 7.0.0 - 7.2.0
int(0) Fatal error: Uncaught TypeError: Argument 1 passed to int() must be of the type integer, string given, called in /in/sKmfL on line 12 and defined in /in/sKmfL:7 Stack trace: #0 /in/sKmfL(12): int('foobar') #1 {main} thrown in /in/sKmfL on line 7
Process exited with code 255.
Output for 5.3.19 - 5.6.28
int(0) Catchable fatal error: Argument 1 passed to int() must be an instance of int, string given, called in /in/sKmfL on line 12 and defined in /in/sKmfL on line 7
Process exited with code 255.