3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $num = "8 and "; var_dump($num); var_dump((int)$num); var_dump((float)$num); $num = " and 8 "; var_dump($num); var_dump((int)$num); var_dump((float)$num); $num = "8 "; var_dump($num); var_dump((int)$num); var_dump((float)$num); $num = " 8"; var_dump($num); var_dump((int)$num); var_dump((float)$num);
based on H7d2I
Output for 5.3.23 - 7.3.0rc3
string(9) "8 and " int(8) float(8) string(10) " and 8 " int(0) float(0) string(5) "8 " int(8) float(8) string(5) " 8" int(8) float(8)