Go to file
R. Eric Wheeler 38825cae12 Updated readme 2016-10-08 19:07:07 -07:00
Tests Initial commit 2016-10-08 19:00:31 -07:00
src/Sikofitt/Functions Initial commit 2016-10-08 19:00:31 -07:00
.gitignore Initial commit 2016-10-08 19:00:31 -07:00
.php_cs Initial commit 2016-10-08 19:00:31 -07:00
.travis.yml Initial commit 2016-10-08 19:00:31 -07:00
LICENSE Initial commit 2016-10-08 19:00:31 -07:00
README.md Updated readme 2016-10-08 19:07:07 -07:00
bootstrap.php Initial commit 2016-10-08 19:00:31 -07:00
composer.json Initial commit 2016-10-08 19:00:31 -07:00
phpunit.xml Initial commit 2016-10-08 19:00:31 -07:00

README.md

is-class

Build Status

This program simply does one thing.

It creates a function is_class to go along with the many other 'is' functions.

is_object exists although it will return true if you execute is_object(new \stdClass()) to me that seems like unexpected behavior. When somebody wants to find out if something is a class, they are usually not testing \stdClass.

is_a exists, but you need to know the name of the class in question. You simply can't call is_a($class);.

This function can be called as is_class($class), which will return true for interfaces or traits. The second way is is_class($class, true), where true means strict, which will return false if anything is an interface or trait.

The function always returns false for \stdClass, you can use is_object for that.

Tests

phpunit