-
-
Save shmaltorhbooks/5568657 to your computer and use it in GitHub Desktop.
Call method from parent class with unknown arguments length
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 Demo extends ParentClass | |
{ | |
function demoParent(...$arguments) | |
{ | |
// some overrided logic | |
return (new \ReflectionClass(get_class($this))) | |
->getParentClass() | |
->getMethod(__METHOD__) | |
->invokeArgs($this, $arguments) | |
; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment