3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class test { function __toString() { return 'hello'; } } var_dump(is_scalar(null)); var_dump(is_scalar(array())); var_dump(is_scalar('null')); var_dump(is_scalar(0)); var_dump(is_scalar(1)); var_dump(is_scalar(1.2)); var_dump(is_scalar(new test()));
Output for 4.3.0 - 7.1.0
bool(false) bool(false) bool(true) bool(true) bool(true) bool(true) bool(false)