Created
July 26, 2021 00:45
-
-
Save EricMcWinNer/30fdcfa8e40ae723247074f55933a2f2 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
<?php | |
class A { | |
public static function staticMethod() { | |
echo "I am static"; | |
} | |
public function nonStaticMethod() { | |
echo "I am not static" . self::staticMethod(); // This works nicely. | |
} | |
} | |
$a = new A(); | |
$a->nonStaticMethod(); // I am staticI am not static |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment