Click here to get back home

PHP Notice vs. Warning

 HomeNewsGroups | Search | About
 comp.lang.php    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
PHP Notice vs. Warning yawnmoth 08-05-2008
Get Chitika Premium
Posted by yawnmoth on August 5, 2008, 4:25 pm
Please log in for more thread options
Say I have the following file:

<?php
unpack('Na/Nb', str_repeat(chr('0'), 7));
?>

One user claims it generates the following error for them:

PHP Notice: in file test.php on line 2:
unpack() [function.unpack]: Type N: not enough input, need 4, have 3

For me, however, it generates this error:

Warning: unpack() [function.unpack]: Type N: not enough input, need 4,
have 3 in /path/to/test.php on line 2

My question is... why are we getting different errors? I'm running
PHP5. At present, I'm not sure which version of PHP they're running.

Posted by Michael Fesser on August 5, 2008, 4:57 pm
Please log in for more thread options
.oO(yawnmoth)

>Say I have the following file:
>
><?php
>unpack('Na/Nb', str_repeat(chr('0'), 7));
>?>
>
>One user claims it generates the following error for them:
>
>PHP Notice: in file test.php on line 2:
>unpack() [function.unpack]: Type N: not enough input, need 4, have 3
>
>For me, however, it generates this error:
>
>Warning: unpack() [function.unpack]: Type N: not enough input, need 4,
>have 3 in /path/to/test.php on line 2
>
>My question is... why are we getting different errors?

Different PHP versions.

>I'm running
>PHP5. At present, I'm not sure which version of PHP they're running.

Looks like the severity level for this issue was changed with some
version, which is not that unusual. If you know your and the user's PHP
version, you could have a look at the changelogs in order to see when
this change took place.

Micha

Similar ThreadsPosted
notice and warning July 16, 2008, 11:22 am
implode notice February 13, 2005, 10:16 am
Re: Notice: Undefined index January 24, 2007, 8:30 am
Notice: Undefined variable August 12, 2007, 8:06 am
PHP Notice: Undefined property: April 4, 2008, 8:00 pm
Undefined offset notice with explode May 31, 2005, 2:55 am
apache error log fills up with php notice: September 16, 2005, 3:19 pm
Newbie - Notice: Undefined variable October 8, 2005, 11:25 am
Notice: Undefined index: Error April 25, 2007, 1:42 am
How to avoid 'Notice: Trying to get property of non-object' March 18, 2008, 3:26 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap