Re: Functions with Static Variables vs. Classes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Zoltán Németh" <znemeth@xxxxxxxxxxxxxx>
>>   function example($elem='') {
>>     static $store = array();
>
> AFAIK the above line should cause an error on the second run of the
> function, as you declare the same static variable for the second time.
>
> or am I wrong?

I think so - otherwise static Variables would be quite senseless. The line
starting with static is (so do I think) once evaluated at compile-time or at
the first run and the ignored.

Thomas 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux