You are here: Re: when to serialize/unserialize « PHP Programming Language « IT news, forums, messages
Re: when to serialize/unserialize

Posted by Colin McKinnon on 11/21/83 11:26

sandy wrote:

>
> So, I've been trying to learn how php sessions work.
> I'm new at php sessions. Bear with me.
>
<snip>
> session_start();
> $test_class = new TestClass();
> session_register('test_class')
>
>
> So, if $REQUEST_METHOD=='POST'
> {
> I can say:
> $test_class->show();
> ...and it works. So php must have automatically
> serialized the class for me. So why and when
> do you ever need to explicitly say something
> about serialize($this) or unserialize($that)
> ...when the system seems to be doing it anyway.
>
> }
>

You're writing your code assuming that register_globals is on - not a good
idea, particularly when you're learning.

In answer to your question - 'cos sometimes you may want to keep an object
somehwere other than the session.

C.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация