Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.4.4

Request #12616 spews if php error_reporting is set to E_STRICT
Submitted: 2007-12-05 07:11 UTC
From: haikuty Assigned:
Status: Bogus Package: HTTP_Request (version 1.4.2)
PHP Version: 5.2.3 OS: Mac OS X 10.4.10
Roadmaps: (Not assigned)    
Subscription  


 [2007-12-05 07:11 UTC] haikuty (Tyler Haiku)
Description: ------------ I just tried to install this and test it with my setup and I get all kinds of warnings/errors with the most simple script. It appears that this code is not able to work with the error_reporting including E_STRICT in php 5.x which is unfortunate. We require all our code to be clean and spew no errors with error_reporting at E_ALL | E_STRICT This module should be cleaned up to work without spewing when E_STRICT is enabled. thank you. Test script: --------------- <?php require_once "HTTP/Request.php"; $req =& new HTTP_Request("http://www.yahoo.com/"); if (!PEAR::isError($req->sendRequest())) { echo $req->getResponseBody(); } ?> Expected result: ---------------- see yahoo home page contents in output and no Strict Standards: error warnings of Depreciated and so on, see below. Actual result: -------------- Strict Standards: Assigning the return value of new by reference is deprecated in /opt/local/lib/php/PEAR/HTTP/Request.php on line 402 Strict Standards: Assigning the return value of new by reference is deprecated in /opt/local/lib/php/PEAR/HTTP/Request.php on line 720 Strict Standards: Assigning the return value of new by reference is deprecated in /opt/local/lib/php/PEAR/HTTP/Request.php on line 733 Strict Standards: Assigning the return value of new by reference is deprecated in /opt/local/lib/php/PEAR/HTTP/Request.php on line 778 Strict Standards: Assigning the return value of new by reference is deprecated in /opt/local/lib/php/PEAR.php on line 569 Strict Standards: Assigning the return value of new by reference is deprecated in /opt/local/lib/php/PEAR.php on line 572 Strict Standards: Redefining already defined constructor for class Net_URL in /opt/local/lib/php/PEAR/Net/URL.php on line 124 Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /opt/local/lib/php/PEAR/HTTP/Request.php on line 678 Strict Standards: Non-static method PEAR::getStaticProperty() should not be called statically, assuming $this from incompatible context in /opt/local/lib/php/PEAR/HTTP/Request.php on line 708 Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /opt/local/lib/php/PEAR/HTTP/Request.php on line 723 Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /opt/local/lib/php/PEAR.php on line 281 Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /opt/local/lib/php/PEAR/HTTP/Request.php on line 725 Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /opt/local/lib/php/PEAR.php on line 281 Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /opt/local/lib/php/PEAR/HTTP/Request.php on line 755 Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /opt/local/lib/php/PEAR.php on line 281 Strict Standards: Non-static method PEAR::isError() should not be called statically in /opt/local/apache2/htdocs/bookseller/test.php on line 60 Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /opt/local/lib/php/PEAR.php on line 281

Comments

 [2007-12-07 12:35 UTC] avb (Alexey Borzov)
Fixing E_STRICT errors is not possible as the package should run under PHP4.
 [2007-12-07 18:20 UTC] haikuty (Tyler Haiku)
Well, coming from other software development arenas that strikes me as a pretty weak excuse. Is there no #ifdef type functionality that can make the code work well in both places? Also, at least some of the E_STRICT things are about optional behaviors that are not necessary in 4.0, at least that's my understanding. For example using $foo =& new blah (); can be replaced with $foo = new blah();, can't it?