For Programmers: Free Programming Magazines  


Home > Archive > PHP Questions and Answers > October 2006 > Re: [PHP-QA] PHP 5.2.0RC6 Testing









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PHP-QA] PHP 5.2.0RC6 Testing
Phil Driscoll

2006-10-20, 7:57 am

Tested with all my code, phpMyAdmin and Phorum - no problems found.

Tested with Squirrelmail 1.4.8 (current stable release) and the following
warnings are displayed when viewing an email (which definitely weren't there
on RC5):

Warning: preg_split() expects parameter 4 to be long, string given
in .../functions/imap_messages.php on line 808
Line 808 reads
$flags = preg_split('/ /', $regs[1],-1,'PREG_SPLIT_NI_EMPTY');

Warning: Invalid argument supplied for foreach() in .../functions/mime.php on
line 52
Line 52 reads foreach ($flags as $flag)
(this is because the $flags is the one returned above).

The misspelling and quoting of the PREG_SPLIT_NO_EMPTY constant has been fixed
in SquirrelMail's development branch:
http://sourceforge.net/tracker/inde...311&atid=100311
however, SquirrelMail version 1.4.8 is very widely deployed.

I'm not sure why RC5 doesn't complain about this, and RC6 does.
--
Phil Driscoll
Ilia Alshanetsky

2006-10-20, 6:56 pm

It looks like a bug to me.... undefined constant converted to a
string where a number is expected is a clear error.


On 20-Oct-06, at 5:32 AM, Phil Driscoll wrote:

> Tested with all my code, phpMyAdmin and Phorum - no problems found.
>
> Tested with Squirrelmail 1.4.8 (current stable release) and the
> following
> warnings are displayed when viewing an email (which definitely
> weren't there
> on RC5):
>
> Warning: preg_split() expects parameter 4 to be long, string given
> in .../functions/imap_messages.php on line 808
> Line 808 reads
> $flags = preg_split('/ /', $regs[1],-1,'PREG_SPLIT_NI_EMPTY');
>
> Warning: Invalid argument supplied for foreach() in .../functions/
> mime.php on
> line 52
> Line 52 reads foreach ($flags as $flag)
> (this is because the $flags is the one returned above).
>
> The misspelling and quoting of the PREG_SPLIT_NO_EMPTY constant has
> been fixed
> in SquirrelMail's development branch:
> http://sourceforge.net/tracker/index.php?
> func=detail&aid=1543573&group_id=311&atid=100311
> however, SquirrelMail version 1.4.8 is very widely deployed.
>
> I'm not sure why RC5 doesn't complain about this, and RC6 does.
> --
> Phil Driscoll
>
> --
> PHP Quality Assurance Mailing List <http://www.php.net/>
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Ilia Alshanetsky
Phil Driscoll

2006-10-20, 6:56 pm

On Friday 20 October 2006 14:17, Ilia Alshanetsky wrote:
> It looks like a bug to me.... undefined constant converted to a
> string where a number is expected is a clear error.

Agreed - I just wonder why RC5 didn't comlain about it.

--
Phil Driscoll
Ilia Alshanetsky

2006-10-20, 6:56 pm

I honestly don't know, I've checked the PCRE code and there was no
change in the code that would result in a displaying of error vs not
doing so. How did earlier PHP versions behave?


On 20-Oct-06, at 9:24 AM, Phil Driscoll wrote:

> On Friday 20 October 2006 14:17, Ilia Alshanetsky wrote:
> Agreed - I just wonder why RC5 didn't comlain about it.
>
> --
> Phil Driscoll
>


Ilia Alshanetsky
Phil Driscoll

2006-10-20, 6:56 pm

On Friday 20 October 2006 14:29, Ilia Alshanetsky wrote:
> I honestly don't know, I've checked the PCRE code and there was no
> change in the code that would result in a displaying of error vs not
> doing so. How did earlier PHP versions behave?

I've just tried 5.0.2RC1 and RC4 - they display the warning messages.
Went back to 5.0.2RC5 and now that is showing the warnings as well. I think
that the duff SquirrelMail code is perhaps executed the first time you view a
message, but not if you view the same message again in the same session.

Sorry for the time waste!
--
Phil Driscoll
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com