Created
July 26, 2021 00:48
-
-
Save EricMcWinNer/2cc288355bb205fdfac3f684082d7484 to your computer and use it in GitHub Desktop.
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 A { | |
public function nonStaticMethod(){ | |
echo "I am non-static"; | |
} | |
public static function staticMethod() { | |
echo "I am static" . self::nonStaticMethod(); // Throws error: Non-static method cannot be called statically | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment