diff --git a/lib/MagicProperties.php b/lib/MagicProperties.php index b8ee75e..3604855 100644 --- a/lib/MagicProperties.php +++ b/lib/MagicProperties.php @@ -15,7 +15,7 @@ trait MagicProperties { if ($methodName === null) { throw new Exception(Exception::NONEXISTENT_PROPERTY, $name); } - return call_user_func([ $this, $methodName ]); + return $this->$methodName(); } public function __isset(string $name): bool { @@ -25,7 +25,7 @@ trait MagicProperties { public function __set(string $name, $value) { $methodName = $this->getMagicPropertyMethodName($name, false); if ($methodName !== null) { - call_user_func([ $this, $methodName ], $value); + $this->$methodName($value); return; }