3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php foreach (['64a', '1.42', '-43b', '+45', '2.34e4', '64'] as $id){ printf("%6s: is_numeric: %6s; ctype_digit: %6s\r\n", $id, b(is_numeric($id)), b(ctype_digit($id))); } function b($b){ return $b?'true':'false'; }
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.22.0, 7.1.0 - 7.2.6
64a: is_numeric: false; ctype_digit: false 1.42: is_numeric: true; ctype_digit: false -43b: is_numeric: false; ctype_digit: false +45: is_numeric: true; ctype_digit: false 2.34e4: is_numeric: true; ctype_digit: false 64: is_numeric: true; ctype_digit: true