Re: [PHP] Weird behaviour with references to objects...

2002-11-09 Thread Tim Molendijk
Ernest E Vogelsinger [EMAIL PROTECTED] wrote in message news:5.1.1.6.2.20021108175627.00b44880;mail.vogelsinger.at... This is clearly said in your PHP.ini file: ; Whether to enable the ability to force arguments to be passed by reference ; at function call time. This method is deprecated

Re: [PHP] Weird behaviour with references to objects...

2002-11-08 Thread Ernest E Vogelsinger
At 03:36 08.11.2002, Tim Molendijk said: [snip] begin first code snippet ?php /* New Container object created. At the same time it sets a Child object in its $child attribute. (This is indicated by passing TRUE.) */

Re: [PHP] Weird behaviour with references to objects...

2002-11-08 Thread Maxim Maletsky
...) It's to do with the way the assignment operator works.. -Original Message- From: Tim Molendijk [mailto:tawm;wanadoo.nl] Sent: Friday, November 08, 2002 4:14 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Weird behaviour with references to objects... Hi all, First of all

Re: [PHP] Weird behaviour with references to objects...

2002-11-08 Thread Tim Molendijk
Ernest E Vogelsinger [EMAIL PROTECTED] wrote in message news:5.1.1.6.2.20021108092657.02befe20;mail.vogelsinger.at... At 03:36 08.11.2002, Tim Molendijk said: [snip] Ahh - culprit 1: You said the container is creating a child instance - I assume it's

Re: [PHP] Weird behaviour with references to objects...

2002-11-08 Thread Ernest E Vogelsinger
At 16:48 08.11.2002, Tim Molendijk spoke out and said: [snip] The problem is solved and I completely understand why now. This last thing is thanks to you Ernest. [snip] Glad it works - you're very welcome :) --

Re: [PHP] Weird behaviour with references to objects...

2002-11-08 Thread Ernest E Vogelsinger
One more: At 16:48 08.11.2002, Tim Molendijk spoke out and said: [snip] This is not true in my case, because instead of doing: function add($child) { ... } I do: function add($child) { ... } and then call it with: $this-add($child); This has the same

Re: [PHP] Weird behaviour with references to objects...

2002-11-08 Thread Tim Molendijk
Ernest E Vogelsinger [EMAIL PROTECTED] wrote in message news:5.1.1.6.2.20021108165218.03238948;mail.vogelsinger.at... One more: True for now, but this is officially deprecated. Functions or methods accepting a reference are required to be prototyped that way - this helps you not to forget to

Re: [PHP] Weird behaviour with references to objects...

2002-11-08 Thread Ernest E Vogelsinger
At 17:04 08.11.2002, Tim Molendijk spoke out and said: [snip] Yes I know it is poor programming habits to do like I did... But I have a reason for it. I have quite a lot methods that accept objects *optional*. So f.e.: --- class Product { var $language;

Re: [PHP] Weird behaviour with references to objects...

2002-11-08 Thread Tim Molendijk
Ernest E Vogelsinger [EMAIL PROTECTED] wrote in message news:5.1.1.6.2.20021108170633.00b8cb60;mail.vogelsinger.at... You might always simply omit the parameter when calling the function (you'll get a notice about that if enabled). You just cannot pass constants: function Product($language)

Re: [PHP] Weird behaviour with references to objects...

2002-11-08 Thread Ernest E Vogelsinger
At 17:32 08.11.2002, Tim Molendijk spoke out and said: [snip] why do you think it won't be supported by future versions? all i do is passing an object by reference. because in this case this function always should accept its argument as a reference and

Re: [PHP] Weird behaviour with references to objects...

2002-11-07 Thread Marco Tabini
I'm not sure if my answer is going to be of much help, but I think this has to do with the way PHP handles references and copies of objects--it uses what I understand is a lazy copy mechanism, and thus the results on object manipulations can yield odd results. There was a discussion on a similar

Re: [PHP] Weird behaviour with references to objects...

2002-11-07 Thread Tom Rogers
Hi, Friday, November 8, 2002, 12:36:03 PM, you wrote: TM First of all I would like to say that I know this is a lot of text but I TM would be very pleased if you take a little time to read it nevertheless. The TM situation described below is not complicated at all... TM

Re: [PHP] Weird behaviour with references to objects...

2002-11-07 Thread Mike Mannakee
This sounds like a matter that ought to make it to the programmers who code PHP itself. In the meantime can you code around it now that you know the bug is there? Mike Marco Tabini [EMAIL PROTECTED] wrote in message news:1036725595.21741.868.camel;localhost.localdomain... I'm not sure if my

Re: [PHP] Weird behaviour with references to objects...

2002-11-07 Thread Tim Molendijk
Hi all, First of all, thank you for the suggestions. Actually I accidently found a solution to the problem... Not that I understand it now, I just found a way to cope with it. By changing the first line of the first code snippet: $testContainer1 = new Container(TRUE); into:

RE: [PHP] Weird behaviour with references to objects...

2002-11-07 Thread Martin Towell
new object (if that's not too confusing...) It's to do with the way the assignment operator works.. -Original Message- From: Tim Molendijk [mailto:tawm;wanadoo.nl] Sent: Friday, November 08, 2002 4:14 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Weird behaviour with references to objects