2017 © Pedro Peláez
 

library is_class

Creates a function for is_class

image

sikofitt/is_class

Creates a function for is_class

  • Sunday, October 9, 2016
  • by sikofitt
  • Repository
  • 1 Watchers
  • 0 Stars
  • 14 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

is-class

This program simply does one thing., (*1)

It creates a function is_class to go along with the many other 'is' functions., (*2)

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., (*3)

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

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., (*5)

The function always returns false for \stdClass, you can use is_object for that, unless you extend \stdClass., (*6)

Tests

phpunit, (*7)

The Versions

09/10 2016

v1.0.0.x-dev

1.0.0.9999999-dev

Creates a function for is_class

  Sources   Download

GPL-3.0

The Requires

  • php >=5.4

 

The Development Requires

by Avatar sikofitt

09/10 2016

v1.x-dev

1.9999999.9999999.9999999-dev

Creates a function for is_class

  Sources   Download

GPL-3.0

The Requires

  • php >=5.4

 

The Development Requires

by Avatar sikofitt

09/10 2016

dev-master

9999999-dev

Creates a function for is_class

  Sources   Download

GPL-3.0

The Requires

  • php >=5.4

 

The Development Requires

by Avatar sikofitt

09/10 2016

v1.0.0

1.0.0.0

Creates a function for is_class

  Sources   Download

GPL-3.0

The Requires

  • php >=5.4

 

The Development Requires

by Avatar sikofitt