Edit report at http://bugs.php.net/bug.php?id=49387&edit=1

 ID:                 49387
 Updated by:         [email protected]
 Reported by:        fernando dot wendt at gmail dot com
 Summary:            E_DEPRECATED looks like a fatal error, even off
 Status:             Closed
 Type:               Bug
 Package:            *Configuration Issues
 Operating System:   Windows XP
 PHP Version:        5.3.0
-Assigned To:        
+Assigned To:        rasmus
 Block user comment: N
 Private report:     N

 New Comment:

Works fine here:



<?php

error_reporting(-1);

echo ereg_replace('abc','abc','123');

error_reporting(0);

echo ereg_replace('abc','abc','456');



Outputs:



PHP Deprecated:  Function ereg_replace() is deprecated in 

/home/sites/wepay.com/current/u on line 3



Deprecated: Function ereg_replace() is deprecated in 

/home/sites/wepay.com/current/u on line 3

123456



That is, there is only a deprecated warning printed for line 3, nothing
for line 

5.


Previous Comments:
------------------------------------------------------------------------
[2011-02-28 18:15:01] thorn at thorn dot ch

I've the same problem.



I upgraded to PHP Version 5.3.3-7 (Debian/Squeeze stable) and got now
those error messages about the DEPRECATED use of function
"ereg_replace"



Following php.ini entries does NOT work to disable the DEPRECATED
message:

error_reporting  =  E_ALL & ~E_NOTICE & ~E_DEPRECATED

error_reporting =
E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR|E_CORE_WARNING



Now I had disabled the output:

display_errors = Off



But the logs will be overfilled as long the deprecated functions are in
use... :-(

------------------------------------------------------------------------
[2009-08-27 19:02:36] fernando dot wendt at gmail dot com

Ops!



Trying to reproduce it twice, it points me to be working fine :)



Trully, there is a incomplete behavior present at phpPgAdmin (method
"printHeader", that have junt one "if" trying to change document header.
That was why the script seems to be stoping anyway.



Sorry, its all right. Bellows, a little buggy script to confirm this.



<?php



        class Doit{

          private $foo;

          

          public function __construct(){

            $this->foo = 'Something';     

          }

          

          public function getfoo(){

                  return($this->foo);

          }     

        }

        

        $data =& new Doit(); //Deprecated issue

        echo $data->getfoo;

        

        $xpto = 12; //Logical follows

        echo $xpto;

        

        pg_connect();//Missing function data



?>

------------------------------------------------------------------------
[2009-08-27 16:17:01] [email protected]

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.



------------------------------------------------------------------------
[2009-08-27 12:53:36] fernando dot wendt at gmail dot com

Description:
------------
PHP is ignoring the php.ini error_reporting configuration, and is always
hangin up scripts with the E_DEPRACATED message.



The default error_reporting = E_ALL & ~E_DEPRACATED is not working. All
depracated warnings are working as fatal errors, and i believe that was
not the intention it supposed to do.



The only way to avoid this (at least on my workaround) is setting up the
display_errors = Off (even on my workstation).





Reproduce code:
---------------
Try some script that have depracated function or issue to work. It will
freeze as a fatal error, pointing a depracated message.

Expected result:
----------------
First, it should respect the php.ini ~E_DEPRECATED flag and then show
deprecated issues as warnings, not as fatal errors.

Actual result:
--------------
php.ini ~E_DEPRECATED is not working: his behavior looks like a fatal
error, and is not being respected if is on or off.


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=49387&edit=1

Reply via email to