Last active
August 17, 2017 23:21
-
-
Save sbreker/5674d336a84e24635a5540b9e16b8cf0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
interface foo { } | |
class object { } | |
class baseUser extends object { } | |
class myUser extends baseUser implements foo { } | |
$user = new myUser(); | |
print("class_implements value: " . json_encode(class_implements('myUser')) . "\n"); | |
print("is_instance_of value: " . is_subclass_of($user,'baseUser') . "\n"); | |
print("is_instance_of value: " . is_subclass_of($user,'object') . "\n"); | |
// Output: | |
// class_implements value: {"foo":"foo"} | |
// is_instance_of value: 1 | |
// is_instance_of value: 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment