Re: php5 - possible bug discovered

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Robert, Stut & List

Thanks for your replies which arrived after I had gone to bed |-Z

Robert :-

> In PHP5 objects are no longer copied when assigned. Instead the object's
> handle is assigned (similar to a reference but not quite). So the
> behaviour is as expected.

Stut :-

> > I think I have discovered a bug in php5.  If I haven't, I've discovered
> > a bug in the documentation or a bug in my brain.
> 
> Start here: http://php.net/language.oop5.cloning

It's amazing what a good night's sleep will do :-)

I could not find that page last night even though I was sure it must
have existed and I can see that it is a well documented and encountered
problem.

My main obesrvation is that I'm glad that I decided to revisit all my
old PHP4 stuff and rewrite or clean it up.  I have hundreds of

$Working_Class = $Under_Class;

lines in my code as well as

$Upper_Class = & $Aristocracy;

lines too.  I think the documentation on references needs updating to
reflect PHP 5's behaviour a little more accurately because I can see
this causing serious problems to somebody just copying their code blindly.

I have just built a client a development server using php5 instead of
php4 and turned zend.ze1_compatibility_mode on so that their old CMS would
work - I just hadn't realised that the cloning problem was solved by this.

Oh well, now I'm fresh I can crack on :-)

TTFN


D
php/general-2007-10-09.tx                              robert@xxxxxxxxxxxxx
                                                       stuttle@xxxxxxxxx
                                                       php-general
+----------------------------------------------------------------------------+
| Dave Restall, Computer Nerd, Cyclist, Radio Amateur G4FCU, Bodger          |
| Mob +44 (0) 7973 831245      Skype: dave.restall             Radio: G4FCU  |
| email : dave@xxxxxxxxxxx                     Web : Not Ready Yet :-(       |
+----------------------------------------------------------------------------+
| birth, n:                                                                  |
|     The first and direst of all disasters.                                 |
|         -- Ambrose Bierce, "The Devil's Dictionary"                        |
+----------------------------------------------------------------------------+

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux