Re: [PHP-DEV] Help wanted: Operator - and a class in a PHP extension

2001-07-20 Thread David Eriksson

Quoting David Eriksson [EMAIL PROTECTED]:

  This time, the last echo line will get the value of $s1-a and not
  $s2-a.
  
  handle_property_get is only called on the $s1 instance and not on
 the
  $s2
  instance of the object.
  
  I will write a PHP extension that just shows this feature.
 
 Now that I have written the special extension to test this, I am
 beginning to
 suspekt an error in the way I treat the zend_property_reference
 parameter passed
 to the handlers that get/set properties.
 
 Would someone who be able to explain this structure to me? Maybe Zeev?
 :-)
 
 I'll read the source meanwhile... :-)

It was, of course, my own fault. I did not use the zend_property_reference
parameter properly. Like anyone cares... :-)

Regards,

-\- David Eriksson -/-

An expert in a particular computer language is really an expert
in the work-arounds necessary to use this language to perform
useful work. - Richard B. Johnson

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Help wanted: Operator - and a class in a PHP extension

2001-07-19 Thread David Eriksson

Quoting David Eriksson [EMAIL PROTECTED]:

 First, look att this piece of pure PHP code:
 
 
 
 ?php
 
 class S
 {
 var $a;
 var $x;
 }
 
 $s1 = new S();
 $s1-a = 42;
 
 $s2 = new S();
 
 $s2-a = 4711;
 $s2-x = $s1;
 
 echo $s1-a.\n;
 
 $s3 = $s2-x;
 echo $s3-a.\n;
 
 echo $s2-x-a.\n;
 
 ?
 
 
 
 All three of the echo lines above will output the value 42.
 
 Now consider the same code, but S is class in a PHP extension that has
 implemented the handle_property_get function to retrieve properties.
 
 This time, the last echo line will get the value of $s1-a and not
 $s2-a.
 
 handle_property_get is only called on the $s1 instance and not on the
 $s2
 instance of the object.
 
 I will write a PHP extension that just shows this feature.

Now that I have written the special extension to test this, I am beginning to
suspekt an error in the way I treat the zend_property_reference parameter passed
to the handlers that get/set properties.

Would someone who be able to explain this structure to me? Maybe Zeev? :-)

I'll read the source meanwhile... :-)

Regards,

-\- David Eriksson -/-

An expert in a particular computer language is really an expert
in the work-arounds necessary to use this language to perform
useful work. - Richard B. Johnson

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]