Skip to content

Commit 645a4d8

Browse files
SpiGAndromedajaviereguiluz
authored andcommitted
[Validator] PHP 7.4 uninitialized typed property handling
1 parent 2e69b0b commit 645a4d8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

validation.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,13 @@ class to have at least 3 characters.
611611
}
612612
}
613613
614+
.. caution::
615+
616+
With PHP 7.4, typed properties were introduced. If a property is accessed
617+
before a value is assigned (explicitly or as a default value), PHP will
618+
throw an exception. To avoid that, the Validator will use ``null`` as the
619+
properties value if it's uninitialized.
620+
614621
.. index::
615622
single: Validation; Getter constraints
616623

0 commit comments

Comments
 (0)