php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29688 E_STRICT don't work
Submitted: 2004-08-15 19:03 UTC Modified: 2004-08-15 19:16 UTC
From: fhenninot at freesurf dot fr Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.0.1 OS: RH9
Private report: No CVE-ID: None
 [2004-08-15 19:03 UTC] fhenninot at freesurf dot fr
Description:
------------
if 'error_reporting' is set to E_STRICT in php.ini, it's impossible to reset it in code.
And if 'error_reporting' is not set to E_STRICT in the php.ini, it's impossible to set it in code.

It's a really big problem for the compatibility with PHP4 program.

Reproduce code:
---------------
<?php
echo "start : ".error_reporting()."<br>";

error_reporting(E_ALL ^E_STRICT);
echo "after : ".error_reporting()."<br>";
class foo{
        var $toto;

        function foo(){
                echo "construct<br>";
        }
}

$instance =& new foo();
echo "undefined var : ".$novar;

echo "End : ".error_reporting()."<br>";
?>


Expected result:
----------------
if E_STRICT in php.ini, i must have just a 'NOTICE' error :
[client xxx.xxx.xxx.xxx] PHP Notice:  Undefined variable:  novar in /usr/local/apache/htdocs/test.php on line 15


Actual result:
--------------
I have the notice error message but i've too the 'STRICT' error message :
[client xxx.xxx.xxx.xxx] PHP Strict Standards:  var: Deprecated. Please use the public/private/protected modifiers in /usr/local/apache/htdocs/test.php on line 7
[client xxx.xxx.xxx.xxx] PHP Strict Standards:  Assigning the return value of new by reference is deprecated in /usr/local/apache/htdocs/test.php on line 14


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-15 19:16 UTC] helly@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Your code is wrong.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 14:04:04 2025 UTC