[geeklog-devel] Site breaks when there is one or more upcoming event?

Blank, Jessica Jessica.Blank at mtvnmix.com
Thu Mar 6 13:00:24 EST 2008


We run Apache 2.0, and we run PHP as mod_php.

Here is my modified test function:

---snip---
function func($x, $y, $z = array())
{
var_dump($z);

     foreach ($z as $k => $v) {
         echo $k . ' => ' . $z . '<br>';
     }
}
---snip---

This function works fine when I call it like this:
func('MyX', 'MyY', array());

However, when I call it like this:
func('MyX', 'MyY', NULL);

...then I get this warning:
Warning: Invalid argument supplied for foreach() in /PATH/test.php on line X


-----Original Message-----
From: geeklog-devel-bounces at lists.geeklog.net on behalf of Joe Mucchiello
Sent: Thu 3/6/2008 2:50 AM
To: Geeklog Development
Subject: Re: [geeklog-devel] Site breaks when there is one or more upcoming event?
 
At 10:31 PM 3/5/2008, Blank, Jessica wrote:
>Content-class: urn:content-classes:message
>Content-Type: multipart/alternative;
>         boundary="----_=_NextPart_001_01C87F3A.8FF7A5B7"
>
>We have PHP 4.3.9... and your test script worked. However, my copy 
>of Geeklog does not...
>===========
>foreach() doesn't work on an empty array if said array was created 
>in the function declaration itself, a la:
>     function a($x, $y, $z = array()) {}
>===========
>
>I may have perhaps uncovered a rather obscure bug in PHP 4.3.9? 
>However, if I've encountered this error, others will likely 
>encounter it as well. Perhaps my line should be added to the CVS 
>copy just in case others are running the same version of PHP as me...

Weird, my test script creates the empty array in the function 
declaration so this would have to be a really, really obscure bug.

What server are you running on? Are you running as CGI or mod_php?


----
Joe Mucchiello
Throwing Dice Games
http://www.throwingdice.com 

_______________________________________________
geeklog-devel mailing list
geeklog-devel at lists.geeklog.net
http://eight.pairlist.net/mailman/listinfo/geeklog-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist8.pair.net/pipermail/geeklog-devel/attachments/20080306/2ae2b1af/attachment.html>


More information about the geeklog-devel mailing list