Level 36
@godbout http://php.net/manual/en/language.oop5.overloading.php
class YourClass {
public function __call($name, $arguments)
{
}
}
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Wondering if there's a way to avoid the duplication of a couple of helper functions I did for my tests:
function birth($action, $arguments)
{
...
}
function raw()
{
return birth(__FUNCTION__, func_get_args());
}
function make()
{
return birth(__FUNCTION__, func_get_args());
}
function create()
{
return birth(__FUNCTION__, func_get_args());
}
birth is where everything happens obviously. I'm pretty sure I don't know PHP enough and there's a better way rather than copypasting each function. It doesn't really matter per se, but I'm curious. Any thoughts?
Please or to participate in this conversation.