Cannot re-assign $this

php.internals

npguy

22 years ago
Hi, when $this is assigned within $this object like $this = $this->new_from_string($rrdata); displays an error "Cannot re-assign $this" I am using php5 beta4.
-- Best regards, npguy npguy€websurfer.com.np

Joseph Lee

22 years ago
Here's the reply to a similar question in http://www.zend.com/php/ask_experts.php : "The fact that you could change in PHP 4, was never really meant to be although it worked. In PHP 5 we removed this option due to performance and semantic reasons. In PHP 5, you can either use a factory method pattern or throw an exception on error in the constructor." Joe Lee. -----Original Message----- From: npguy [mailto:npguy@websurfer.com.np] Sent: Tuesday, March 09, 2004 7:55 AM To: internals@lists.php.net Subject: [PHP-DEV] Cannot re-assign $this Hi, when $this is assigned within $this object like $this = $this->new_from_string($rrdata); displays an error "Cannot re-assign $this" I am using php5 beta4.
-- Best regards, npguy npguy€websurfer.com.np -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Sara Golemon

22 years ago
I can see from the specific line you pasted that you're talking about Net_DNS. The Lead Maintainer of that package and I are working to resolve this problem without breaking BC. With luck the next release of Net_DNS will contain a fix that allows existing scripts to continue working. -Sara ----- Original Message ----- From: "Npguy" <npguy@websurfer.com.np> Newsgroups: php.internals To: <internals@lists.php.net> Sent: Monday, March 08, 2004 11:54 PM Subject: Cannot re-assign $this