[php-src] Issue #18867: error_reporting() Sometimes Sets Bizarre Values
| From: | miqrogroove | Date: | Mon, 16 Jun 2025 23:56:58 +0000 |
| Subject: | [php-src] Issue #18867: error_reporting() Sometimes Sets Bizarre Values | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-250267@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/18867
Author: miqrogroove
### Description
I'm having a strange problem with PHP 8.2.26 on a DreamHost server. I have a test case that
gives a totally different result when I run it on the PHP sandbox at onlinephp.io, so I don't
understand why this works in some environments but not others.
When setting the error reporting level to
-1 the server is interpreting that as a large
negative integer.
```
<?php
error_log('The default error reporting level is ' . error_reporting());
error_reporting(-1); // Report all errors
error_log('Top of file error reporting level is ' . error_reporting());
error_log('The correct level would be ' . E_ALL);
```
Output:
```
The default error reporting level is 22517
Top of file error reporting level is -10251
The correct level would be 32767
```
The reporting level is being set to -10251 which is not correct, and I'm not
getting any error reports.
Is there a bug here, or is this somehow specific to the server I'm using?
### PHP Version
```plain
PHP 8.2.26 (cli) (built: Nov 21 2024 20:16:53) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.26, Copyright (c) Zend Technologies
with Zend OPcache v8.2.26, Copyright (c), by Zend Technologies
```
### Operating System
_No response_