3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = '011'; var_dump($a); var_dump(is_numeric($a)); var_dump(is_int($a)); var_dump(ctype_digit($a)); echo PHP_EOL; $a = 011; var_dump($a); var_dump(is_numeric($a)); var_dump(is_int($a)); var_dump(ctype_digit($a)); echo PHP_EOL; $a = '11'; var_dump($a); var_dump(is_numeric($a)); var_dump(is_int($a)); var_dump(ctype_digit($a));
based on 5rhEd
Output for 4.3.10 - 4.4.9, 5.0.2 - 7.2.0
string(3) "011" bool(true) bool(false) bool(true) int(9) bool(true) bool(true) bool(false) string(2) "11" bool(true) bool(false) bool(true)
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
string(3) "011" bool(true) bool(false) bool(true) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/sPACK on line 8 PHP_EOLint(9) bool(true) bool(true) bool(false) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/sPACK on line 16 PHP_EOLstring(2) "11" bool(true) bool(false) bool(true)