Re: POST variable and PHP 7

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 29, 2020 at 04:26:53PM -0400, Aziz Saleh wrote:

>    Hey Paul!
>    Are you sure its an error or a notice? I can see  you getting a notice if
>    the item isn't set but not an error.
>    Also this is expected behavior for a long while, it could have been the
>    case that error reporting on php5 didn't show notices by default when php7
>    does.
>    You can hide notices on php7 via error reporting, but I would not
>    recommend it and instead check for the value before using.

I didn't pay a lot of attention; it probably was a notice. However, I'm
pretty merciless with myself. I have my error reporting turned way up.
If PHP complains at all about anything, I want to know about it, and
repair it. In fact, when I switched my Apache server over to PHP 7, I
can't tell you how many errors/notices/warnings I got, using code from
the PHP 5 days.

You used to be able to do this, for example:

echo "Pizza: $pizza[flavor]";

Not anymore. Now I do:

echo "Pizza: {$pizza['flavor']}";

Paul

-- 
Paul M. Foster
http://noferblatz.com
http://quillandmouse.com




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux