3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php use PDO; class Test { public function getDataType($value) { switch($value) { case is_bool($value): return PDO::PARAM_BOOL; case is_null($value): return PDO::PARAM_NULL; case is_integer($value): return PDO::PARAM_INT; default: return PDO::PARAM_STR; } } } Test::getDataType(true);
Output for 7.0.0 - 7.2.0
Warning: The use statement with non-compound name 'PDO' has no effect in /in/0oL8R on line 3 Deprecated: Non-static method Test::getDataType() should not be called statically in /in/0oL8R on line 22
Output for 5.3.18 - 5.6.28
Warning: The use statement with non-compound name 'PDO' has no effect in /in/0oL8R on line 3 Strict Standards: Non-static method Test::getDataType() should not be called statically in /in/0oL8R on line 22