phpphpdoc

How to explain PHPDoc attributes of `@property-read` and `@property-write`?


Given the phpDoc manual, I cannot find explanation about that

but only of @property.

What do they do?


Solution

  • Here's a good explanation on magic properties.

    Basically, @property-write is interpreted - as the name suggests - as a write-only property. The code completion in Eclipse, for example, makes use of this. If your magic property foo is declared "write-only", it wouldn't show up in code completion, when you type $a = $this->f.