Re: Object reference into variable?

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

 



I strongly suggest you put some pressure on you web provider to at least 
upgrade it to the 4.4.7, as 4.2 is way too old to be secure :)

Unfortunately I don't know how this could be accomplished in PHP4, but a 
quick google query returned these:

http://www.hat.net/geeky/php_tricks_-_php_5_clone_in_php4
http://www.dgx.cz/trine/item/how-to-emulate-php5-object-model-in-php4

Someone with more experience might shed some light into this..


Regards,
Hamza.


""Sándor Tamás (GMail)"" <santasoft@xxxxxxxxx> wrote in message 
news:008501c7d8d2$a64f5fe0$3c646464@xxxxxxxxx
I forgot to tell you that I have to use PHP4.2 because of my web provider.
Anything besides of _clone?

SanTa

  ----- Original Message ----- 
  From: Hamza Saglam
  To: "Sándor Tamás (GMail)"
  Sent: Tuesday, August 07, 2007 10:49 AM
  Subject: Re: Object reference into variable?


  You may find the following article interesting. It talks about object
  cloning, which I think what you are after...

  http://www.phpfreaks.com/phpmanual/page/language.oop5.cloning.html


  Regards,
  Hamza.


  ""Sándor Tamás (GMail)"" <santasoft@xxxxxxxxx> wrote in message
  news:003c01c7d8cd$8a84e910$3c646464@xxxxxxxxx
  > Hello,
  >
  > I have a question (what a surprise :-) )
  >
  > I browsed the archives, but didn't find what I'm looking for.
  > I have an object instance stored in some variable (like $myobject). I 
want
  > to save this instance into another variable (like $tempobject). I 
thought,
  > this will be the way:
  >  $myobject = new MyObject();
  >  $tempobject = $myobject;
  > (or I tried this too:
  >  $tempobject = &$myobject)
  >
  > None of them worked, like I cannot access methods in the object:
  >  $tempobject->Foo()
  > gives me an error: calling to method on a non-object variable.
  >
  > How can I tell PHP that $tempobject is a class instance of MyObject, and
  > that I can use it's methods?
  >
  > Thanks,
  > SanTa

-- 
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