[PHP] Re: Object reference into variable?
Have you asked your web provider if they have anything newer than 4.2? I had to ask my profider if they could upgrade my PHP and they already had, I just had to set my PHP to be handled by PHP5 in my Apache handlers. Also, if they won't/can't upgrade that's a bad sign. Move away quickly. - Dan Sándor Tamás (GMail) [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] 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) [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] 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
[PHP] 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) [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] 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
[PHP] Re: Object reference into variable?
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) [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] 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] Re: Object reference into variable?
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) [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] 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) [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] 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
Re: [PHP] Re: Object reference into variable?
Get a new web host that offers PHP 5.2. Anything older than that is a dead end that is about to be retired[1]. There's a nice big list of 5.2-ready web hosts available, too[2]. [1] http://www.php.net/index.php#2007-07-13-1 [2] http://gophp5.org/ On Tuesday 07 August 2007, Sándor Tamás wrote: 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) [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] 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 -- Larry Garfield AIM: LOLG42 [EMAIL PROTECTED] ICQ: 6817012 If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of every one, and the receiver cannot dispossess himself of it. -- Thomas Jefferson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Object reference into variable?
$tempobject *SHOULD* have been an object. Did you spell it right? Was $myobject an object in the first place? Start using var_dump() on all your data and see what's happening. On Tue, August 7, 2007 4:09 am, Sándor Tamás (GMail) wrote: 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) [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] 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 -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php