Re: [PHP-DEV] Raise E_NOTICE for null castings

2017-10-27 Thread li...@rhsoft.net
Am 27.10.2017 um 12:54 schrieb Niklas Keller: pleae don't break code like this which is a useful case for access directly a array field returned from a function and so makes this to a one-liner without check the result public function GetMaxSort(): int {  return

Re: [PHP-DEV] Raise E_NOTICE for null castings

2017-10-27 Thread Niklas Keller
> > Hi, I would like to propose an RFC to raise an E_NOTICE when a variable >> "initialized" to null is casted to other types: >> >> $foo = null; >> var_dump($foo['bar']); >> var_dump($foo . 'bar'); >> var_dump($foo + 2); >> var_dump($foo & 2); >> // At the time being, this code produces no errors

Re: [PHP-DEV] Raise E_NOTICE for null castings

2017-10-27 Thread li...@rhsoft.net
Am 27.10.2017 um 11:49 schrieb Filippo Tessarotto: Hi, I would like to propose an RFC to raise an E_NOTICE when a variable "initialized" to null is casted to other types: $foo = null; var_dump($foo['bar']); var_dump($foo . 'bar'); var_dump($foo + 2); var_dump($foo & 2); // At the time being,