error_reporting
Posted by: Miker12 (---.6-2.cable.virginm.net)
Date: February 24, 2022 03:53PM

WIN 10, wampserver 3.2.7 64 bit

been using php 8.1.2 fine for several weeks, nothing has changed

then suddenly error_reporting is defaulting to E_ALL. while PHP.ini is still at E_ALL & ~E_NOTICE

tried putting E_ALL & ~E_NOTICE into my php programs didnt work

tried error_reporting(32757); in my program, that worked

tried error_reporting = 32757 in php.ini, and that solved it

very odd !

same thing applies to php 8.0
php 7.4.13 is working properly with E_ALL & ~E_NOTICE in php.ini

Options: ReplyQuote
Re: error_reporting
Posted by: Otomatic (Moderator)
Date: February 24, 2022 05:43PM

Hi,

> then suddenly error_reporting is defaulting to E_ALL.

How and where did you see it?

All versions of PHP for Wampserver are with E_ALL
; Development Value: E_ALL
; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT
; [php.net]
error_reporting = E_ALL

What is seen in Left-Click Wampmanager icon -> PHP -> PHP settings?

Wampmanager never changes error_reporting and only reads the value.

Try: Right-Click -> Restart from zero.

Nota : error_reporting(?int $error_level = null): int
The error_reporting() function sets the error_reporting directive at runtime. PHP has many levels of errors, using this function sets that level for the duration (runtime) of your script. If the optional error_level is not set, error_reporting() will just return the current error reporting level.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: error_reporting
Posted by: Miker12 (---.6-2.cable.virginm.net)
Date: February 24, 2022 07:47PM

sorted it - I hadnt realised that PHP 8 had changed undefined variable messages from E_NOTICE to E_WARNING. For some reason I havent understood yet it took a few days to tell me, but anyway problem solved.

thank you !

Options: ReplyQuote


Sorry, only registered users may post in this forum.