FW: [PHP4BETA] Another 'incompatibility' with php3.
| From: | Sander Pilon | Date: | Mon, 09 Aug 1999 23:42:35 +0000 |
| Subject: | FW: [PHP4BETA] Another 'incompatibility' with php3. | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-3264@lists.php.net to get a copy of this message | ||
Because its static.
Function start.
Print (nothing, ok)
You unset it.
You set it.
Print ("hello", ok)
Fuction end.
Function start.
Print (Should print "hello", static variable.)
You unset it.
You set it.
Print ("hello", ok)
Fuction end.
> -----Original Message-----
> From: Joey [mailto:joey@samaritan.com]
> Sent: Tuesday, August 10, 1999 01:32
> To: Sander Pilon
> Subject: Re: [PHP4BETA] Another 'incompatibility' with php3.
>
>
> Maybe I'm stupid, but why would $test1 exist after unset()?
>
> This seems like the expected bahavior to me...
>
>
> --Joey Smith
>
> On Tue, 10 Aug 1999, Sander Pilon wrote:
>
> > <script language="php">
> > class foo
> > {
> > var $test;
> > };
> >
> > function test()
> > {
> > static $test1;
> > echo "BEFORE: $test1 <BR>";
> >
> > unset($test1);
> >
> > $test1 = "Hello";
> > echo "AFTER: $test1 <BR>";
> > }
> >
> > test();
> > echo "-- <BR>";
> > test();
> > </script>
> >
> > PHP4B2 outputs: (static variable is lost)
> >
> > BEFORE:
> > AFTER: Hello
> > --
> > BEFORE:
> > AFTER: Hello
> >
> >
> > PHP3 outputs: (expected behaviour)
> >
> > BEFORE:
> > AFTER: Hello
> > --
> > BEFORE: Hello
> > AFTER: Hello
> >
> >
> >
> > Sander Pilon - President, 3DN.NET, Inc.
> > http://www.3dnews.net
> > http://www.3dn.net
> > mail: sander@3dnews.net
> >
> > --
> > PHP 4 Beta
> >
> >
>