Skip to content

Commit b572c66

Browse files
committed
Merge branch '7.0' into 7.1
* 7.0: implement __isset() together with __get()
2 parents 8e49d0a + 1a1239d commit b572c66

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

components/property_access.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,16 +249,21 @@ The ``getValue()`` method can also use the magic ``__get()`` method::
249249
{
250250
return $this->children[$id];
251251
}
252+
253+
public function __isset($id): bool
254+
{
255+
return true;
256+
}
252257
}
253258

254259
$person = new Person();
255260

256261
var_dump($propertyAccessor->getValue($person, 'Wouter')); // [...]
257262

258-
.. note::
263+
.. caution::
259264

260-
The ``__get()`` method support is enabled by default.
261-
See `Enable other Features`_ if you want to disable it.
265+
When implementing the magic ``__get()`` method, you also need to implement
266+
``__isset()``.
262267

263268
.. _components-property-access-magic-call:
264269

0 commit comments

Comments
 (0)