Keywords: LAMP/MAMP/WAMP - Installers - Technical issue - Other
bndiagnostic ID: 0bd24882-c0b6-b933-80fa-c3cd17fb7cf5
Description:
Hi,
I have LAMP 7.4.28 installed in localmachine.
For debugging purposes I needed to purposely test for errors only to find this strange issue.
On a deprecated error, the error only shows once.
If I refresh the browser, the error does not show again.
The only way I can see the error again is if I restart the services.
Also, no deprecated errors are logged in:
/lampstack-7.4.28-0/apache2/logs/error_log
Other errors are logged.
How can I permanently turn on the errors (if they exist) and make them NOT disappear, unless I fix them?!
I google this but only found:
PHP error shows only once, disappear when refreshed - Stack Overflow (I don’t think its related to my issue)
This is the code I’m testing:
<?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); $field_name = 'test 1'; $field_name2 = 'test 2'; $text{$field_name} = $field_name; $text[$field_name2] = $field_name2; echo $text{$field_name}; echo ""; echo $text[$field_name2]; ?>
I get the expected error
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/username/lampstack-7.4.28-0/apache2/htdocs/www/error-test/phptest.php on line 10
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/username/lampstack-7.4.28-0/apache2/htdocs/www/error-test/phptest.php on line 13
Until I refresh the page, then the error does not show again.
Thanks