From 645a4d89f6f9efc56e9e4fc064a247a9b5b2212c Mon Sep 17 00:00:00 2001 From: Martin Bens Date: Fri, 9 Oct 2020 08:30:27 +0200 Subject: [PATCH] [Validator] PHP 7.4 uninitialized typed property handling --- validation.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/validation.rst b/validation.rst index ae73527188c..b8a5276c4e4 100644 --- a/validation.rst +++ b/validation.rst @@ -611,6 +611,13 @@ class to have at least 3 characters. } } +.. caution:: + + With PHP 7.4, typed properties were introduced. If a property is accessed + before a value is assigned (explicitly or as a default value), PHP will + throw an exception. To avoid that, the Validator will use ``null`` as the + properties value if it's uninitialized. + .. index:: single: Validation; Getter constraints