Doc #75924 [NEW]: No doc: behavior of ini_get('error_reporting') was changed from 5.6 to 7.0

From: Date: Tue, 06 Feb 2018 12:56:45 +0000
Subject: Doc #75924 [NEW]: No doc: behavior of ini_get('error_reporting') was changed from 5.6 to 7.0
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-15414@lists.php.net to get a copy of this message
From:             mikko dot rantalainen at peda dot net
Operating system: Linux/Ubuntu
PHP version:      7.2.2
Package:          Documentation problem
Bug Type:         Documentation Problem
Bug description:No doc: behavior of ini_get('error_reporting') was changed from 5.6 to 7.0

Description:
------------
---
From manual page: http://www.php.net/function.error-reporting
---

The ini_get('error_reporting') was historically the only way to get same
results as current implementation of error_reporting(). However, the
behavior
of ini_get('error_reporting') was changed between PHP 5.6 and 7.0 but
this has not been documented anywhere.

See https://3v4l.org/3lFoe for demo.

Note that this also affect all custom error handlers that inspect value
of ini_get('error_reporting') and not just @ini_get() syntax.

I assume that PHP 7.x ignores at-sign by design (the function name
suggests that this is the value set in the ini file) but this change is
missing official documentation.

I'd prefer this to be documented in both
http://www.php.net/function.error-reporting
and
http://php.net/manual/en/function.ini-get.php

Test script:
---------------
<?php
# different results for PHP 5.x and 7.x:
ini_set('error_reporting', 1);
$a = array();
$a['ini_get'] = ini_get('error_reporting');
$a['error_reporting'] = error_reporting();
$a['@ini_get'] = @ini_get('error_reporting');
$a['@error_reporting'] = @error_reporting();
var_export($a);

Expected result:
----------------
The output should be stable for all versions.

Actual result:
--------------
Behavior is stable for 5.x and all versions of hhvm. However, PHP 7.x
will ignore the at-sign (@) in front of ini_get(). I believe that PHP
4.x used to work identical to 5.x here but I do not have any environment
to test that.

-- 
Edit bug report at https://bugs.php.net/bug.php?id=75924&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=75924&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=75924&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=75924&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=75924&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=75924&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=75924&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=75924&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=75924&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=75924&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=75924&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=75924&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=75924&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=75924&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75924&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=75924&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=75924&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=75924&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=75924&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=75924&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=75924&r=mysqlcfg



Thread (3 messages)

« previous php.doc.bugs (#15414) next »