RE: [PHP4BETA] A quick clarification question about PHP4...
| From: | Zeev Suraski | Date: | Tue, 24 Aug 1999 16:03:40 +0000 |
| Subject: | RE: [PHP4BETA] A quick clarification question about PHP4... | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-3686@lists.php.net to get a copy of this message | ||
At 16:54 24/08/99 , Samuel Liddicott wrote:
-----Original Message-----
From: Jim Brain [mailto:jim_brain@csgsystems.com]
Sent: 24 August 1999 03:38 PM
To: Andi Gutmans; Samuel Liddicott; Zend
Subject: RE: [PHP4BETA] A quick clarification question about PHP4...
This goes to show that if you try to save a few letters when asking a
question, you lose....
After reading the answers, and rereading the compatibility list,
I realized
that you all are talking about static variables, which I never use...
(Sorry, but haven't found a real reason to...)
From how I read Andi's response it is the same. Like you, I think it should
not be. But it is. VERY Sadly. Although it may be nice to think of
initialisers as being like C++ initialisers the fact remains that below
function junk($name,$info,$password,$array)
{
$this->$name=$name;
$this->$info=$info;
$this->$password=$password;
$this->array=$array;
}
is clear to humans but we are now forced to arrange it differently. The
annoying thing is that this is the kind of thing machines are good at! The
parser should recognize the type of things it is can't initialize statically
(or how will it report an error) and then initialize by code it in a secret
hidden pre-construtor.
Uhh no, you're not forced to arrange it differently at all - $this->foo = $bar is an expression, just like $foo = $bar. It's not static initialization, it's not member variable initialization, it's nothing.
The closer we get to C++ the further we get from scripting, I fear.It really has little to do with C++. It has to do with a compile&execute
model, vs. an interpreter model. The compile&execute model is much, much better.Zeev -- Zeev Suraski <zeev@zend.com> http://www.zend.com/ For a PGP public key, finger bourbon@netvision.net.il