Bug #19752 [Ana->WFx]: connect() returns false even if it successfully connects & E_STRICT warnings

From: Date: Tue, 18 Dec 2012 00:48:45 +0000
Subject: Bug #19752 [Ana->WFx]: connect() returns false even if it successfully connects & E_STRICT warnings
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-9427@lists.php.net to get a copy of this message
Edit report at https://pear.php.net/bugs/bug.php?id=19752&edit=1 ID: 19752 Updated by: heino.gehlsen+php@gmail.com Reported By: lead2gold at gmail dot com -Summary: connect() returns false even if it successfully connects +Summary: connect() returns false even if it successfully connects & E_STRICT warnings -Status: Analyzed +Status: Wont fix Type: Bug Package: Net_NNTP Operating System: Centos 5.8 Package Version: 1.5.0RC2 PHP Version: 5.3.19 Roadmap Versions: New Comment: -Summary: connect() returns false even if it successfully connects +Summary: connect() returns false even if it successfully connects & E_STRICT warnings -Status: Analyzed +Status: Wont fix Previous Comments: ------------------------------------------------------------------------ [2012-12-18 00:21:30] caronc Thank you for your feedback, and looking up all the links to back up your comments. I'm satisfied with your suggested workaround for this issue. You can close the ticket as 'Wont Fix' ------------------------------------------------------------------------ [2012-12-17 13:02:54] heino http://pear.php.net/bugs/bug.php?id=12057 (see comment by William Steinford @ 2009-11-04 16:28) ------------------------------------------------------------------------ [2012-12-17 12:59:40] heino I haven't really been active in PEAR for years, but I don't think backward compatibility concerns have become less over time, so the returned false will just have to stay. I was never a fan of handling errors with PEAR_Error and would have preferred exceptions (and thus requiring PHP v5, but back then PEAR had to be v4 compatible. Today this way of error handling seems even more frustrating, but it's old code, and should in my opinion honestly be rewritten to present standards. I actually did write a exception based version a lot of years ago, but the package would have been required to be renamed Net_NNTP2 or something, and there was a new version of NNTP in the works, so I chose to not mess things up. And pretty much dropped PEAR altogether... Regarding the static call to PEAR::isError(), I suppose that it could be changed into $this->isError(), since this is apparently how PHP v5.x interprets it. The Net_NTTP v1.5.x requires PHP5 anyways due to use of PHP's streaming methods instead of Net_Socket, so from this version issues with PHP v4 can safely be ignored. The E_STRICT problem relates to ancient packages in PEAR - such as Net_NNTP and other mail related packages. Therefore you are always better off excluding E_STRICT when 'using' PEAR packages. http://pear.php.net/manual/en/core.pear.pear.seterrorhandling.php http://pear.php.net/manual/en/core.pear.pear.intro.php ------------------------------------------------------------------------ [2012-12-16 22:59:14] caronc One last comment... after experimenting with your sollution, i get the following now: Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /blah/bla on line XYZ Where line ''XYZ' is the PEAR::isError() call.. Now i know i can edit the php.ini file and disable E_STRICT... at least that's what every Google hit I search for tells me to do... but is that really the solution... to disable logging? ------------------------------------------------------------------------ [2012-12-16 22:22:32] caronc Thank you for the followup markup link; I can see this as being a workaround. I'm satisfied with that answer and 'suppose' a patch isn't necessary. I can also understand the requirement for backwards compatibility. Its just odd to call connect() and receive a false value and continue working as everything is okay. With respect to you first comment...are you implying that if i modify the patch to include a isPostingAllowed() public function you'll accept it and we can throw away our entire backwards compatibility discussion? How hypocritical of me to ask eh? ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://pear.php.net/bugs/bug.php?id=19752 -- Edit this bug report at https://pear.php.net/bugs/bug.php?id=19752&edit=1

« previous php.pear.bugs (#9427) next »