Pre proposal for "Class extension functions"
| From: | Andrey O Gromov | Date: | Mon, 24 Sep 2018 11:21:02 +0000 |
| Subject: | Pre proposal for "Class extension functions" | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-103246@lists.php.net to get a copy of this message | ||
Hello.
I want to do RFS proposal for new language concept - Class extension
functions.
Syntax will looks like:
function DateTime->localTime() {
return $this->format('H:i');
}
$date = new DateTime();
echo $date->localTime();
Realisation draft already written (
https://github.com/rjhdby/php-src/commit/a54d7d3f8504d2e15908bb0e44de0b2f87683872
)
It is interesting or not?