On 26/05/2016 17:40, Tom Worster wrote:
0. Fatal error after __construct was called.
>1. Fatal error and abort.
>2. Initialize with appropriate type.
>3. Initialize with null.
Under another 5th option, the problem you state does not arise. Disallow
"public int $x;". Under this option you may declare $x with type int and
an initial value or you may declare $x without type but you may not
declare $x with type (nullable or not) and undefined initial value.
That has the same problem as 2 - not all types can be initialised
statically, so can't be declared this way:
class Foo {
HTTPRequest $request = SOMETHING;
}
How do I safely initialise that?
Regards,
--
Rowan Collins
[IMSoP]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php