<?php $a = "313addad"; $val = intval($a); $valb = (int)$a; var_dump([($valb == $a), ($val == $a), ($val === $a), ($valb === $a)], [$val,$valb]);
Standard input is empty
array(4) { [0]=> bool(true) [1]=> bool(true) [2]=> bool(false) [3]=> bool(false) } array(2) { [0]=> int(313) [1]=> int(313) }
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!