Created
May 12, 2024 10:12
-
-
Save andipyk/1f2ff213b3e66e753d2ffec30dedaf7d 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 BaseClass { | |
public function showMessage() { | |
return "Base message"; | |
} | |
} | |
class DerivedClass extends BaseClass { | |
#[\Override] | |
public function showMessage() { | |
// Explicitly overriding to provide a different message. | |
return "Derived message"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment