Re: [PHP4BETA] Two questions:
| From: | Andreas Pour | Date: | Thu, 13 Apr 2000 20:23:36 +0000 |
| Subject: | Re: [PHP4BETA] Two questions: | ||
| References: | 1 2 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-13525@lists.php.net to get a copy of this message | ||
mark kimsal wrote:
>
> Colin Viebrock wrote:
>
> > 1) Can I not use set_file_buffer() when opening a pointer to STDOUT?
> > If not, how can disable write buffering?
> >
> > 2) What exactly are the differences with classes between PHP3 and PHP4?
> > We are porting several scripts over, and they fail for various reasons.
You can no longer do dynamic assignments in classes -- instead you have
to use a constructor.
Thus, you would need to rewrite your example below as:
<?
$FOO = "hello";
class test {
var $bar;
function test() {
$bar = $GLOBALS["FOO"];
}
function show() {
echo $this->bar;
}
}
> >
> > A simple script that fails is:
> >
> > <?
> > $FOO = "hello";
> > class test {
> > var $bar = $FOO; <<-- this line generates the error
> > function show() {
> > echo $this->bar;
> > }
> > }
> > $a = new test;
> > $a->show();
> > ?>
Ciao,
Andreas