Last active
October 2, 2015 03:38
-
-
Save ejdanderson/2165814 to your computer and use it in GitHub Desktop.
differences in class name references
This file contains hidden or 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
<?php | |
class Foo { | |
function echo_classes() { | |
echo __CLASS__; | |
echo get_class(); | |
echo get_class($this); | |
echo get_called_class(); | |
} | |
} | |
class Bar extends Foo{} | |
$bar = new Bar(); | |
$bar->echo_classes(); | |
/** OUTPUT **/ | |
// Foo | |
// Foo | |
// Bar | |
// Bar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment