Re: [PHP] Arrays within classes

2002-04-11 Thread Erik Price
On Friday, April 5, 2002, at 03:00 PM, Brian McLaughlin wrote: > My problem is that when I assign an empty array to a variable, I get > different results depending on whether that variable is in an object or > not. > In the case of assigning $a=array(); outside of an object, each element > of

Re: [PHP] Arrays within classes

2002-04-05 Thread Brian McLaughlin
Thank you!! Now I need to figure out how to put all this hair back in my head. Brian "Rick Emery" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I corrected the syntax errors Erik found and added var_dump() after each $t > equation/assignment > > The proble

Re: [PHP] Arrays within classes

2002-04-05 Thread Brian McLaughlin
Hi Erik Thanks for the reply. I'm not sure how I missed the opening { in my message -- I copy/pasted the code. But the opening { is definitely there in the code -- I'd get a nice error message if it weren't. I believe it's OK to have a ; after the class def end-brace, but I removed it and I go

RE: [PHP] Arrays within classes

2002-04-05 Thread Rick Emery
riginal Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: Friday, April 05, 2002 1:28 PM To: 'Brian McLaughlin'; [EMAIL PROTECTED] Subject: RE: [PHP] Arrays within classes I corrected the syntax errors Erik found and added var_dump() after each $t equation/assignment The proble

RE: [PHP] Arrays within classes

2002-04-05 Thread Rick Emery
if $words ="abc", then $test->$words means $test->abc Yes, it's in the manual -Original Message- From: Brian McLaughlin [mailto:[EMAIL PROTECTED]] Sent: Friday, April 05, 2002 12:21 PM To: [EMAIL PROTECTED] Subject: [PHP] Arrays within classes This is driving me crazy!

Re: [PHP] Arrays within classes

2002-04-05 Thread Erik Price
I might be completely mistaken here, but it looks like there are a few errors in your code: - No starting brace for the test() method - semi-colon used after class def end-brace - no parentheses after "new test" instance assignment Don't you want to keep your class as general as possible, and p

[PHP] Arrays within classes

2002-04-05 Thread Brian McLaughlin
This is driving me crazy! I've created a class to hold data so I can just put the object into the session rather than saving off each piece of data separately. But I'm getting odd results from the arrays in my class that I can't explain. Here's a hunk of code that demonstrates: $words; ech