Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Sep 10th, 2004, 10:49 PM   #1
kurifu
Expert Programmer
 
kurifu's Avatar
 
Join Date: Jul 2004
Location: Halifax, Nova Scotia (Canada)
Posts: 784
Rep Power: 5 kurifu is on a distinguished road
Send a message via ICQ to kurifu Send a message via MSN to kurifu
Hrml... I found the most interesting possibly bug today in PHP.... perhaps someone could help me verify this?

class User
{
 var $nothing;

 function User( )
 {
   return;
 }
}

$_SESSION[user][7] = array( "Test1", "Test2" );
print_r( $_SESSION );

$user = new User;
print_r( $_SESSION );

In my case $_SESSION[user] was being overwritten with $user. When I changed $_SESSION[user] to $_SESSION[users] the problem went away and $user no longer made its way into the $_SESSION array.

I am running php version 4.3.8
__________________
Clifford Matthew Roche <geek@cliffordroche.com>
Web Hosting: http://www.crd-hosting.com
Consulting: http://www.crdev-consulting.com
kurifu is offline   Reply With Quote
Old Sep 11th, 2004, 5:28 AM   #2
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
I think that's a "feature", not a bug.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Sep 11th, 2004, 11:45 AM   #3
kurifu
Expert Programmer
 
kurifu's Avatar
 
Join Date: Jul 2004
Location: Halifax, Nova Scotia (Canada)
Posts: 784
Rep Power: 5 kurifu is on a distinguished road
Send a message via ICQ to kurifu Send a message via MSN to kurifu
A feature? I could not find anything on PHP.net or in my book on this featue... perhaps you could explain a bit more so I know how to avoid this feature in the future

And why would they implement such a feature?
__________________
Clifford Matthew Roche <geek@cliffordroche.com>
Web Hosting: http://www.crd-hosting.com
Consulting: http://www.crdev-consulting.com
kurifu is offline   Reply With Quote
Old Sep 11th, 2004, 5:32 PM   #4
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
No idea, but it seems it's the sort of thing that requires work to implement in the first place - I don't think it could happen by accident. Try PHP 5.0.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Sep 13th, 2004, 2:36 AM   #5
Berto
Programming Guru
 
Join Date: Aug 2004
Posts: 1,022
Rep Power: 5 Berto is on a distinguished road
Send a message via AIM to Berto Send a message via MSN to Berto
http://www.berto.org/test.php

Have to check if my hosting are running php 5
__________________
"Put your hand on a hot stove for a minute, and it seems like an hour. Sit with a pretty girl for an hour, and it seems like a minute. THAT'S relativity."

- Albert Einstein
Berto is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:43 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC