Hello Marco,

I was saying about GET and POST, not sessions

MS> Hi there

MS> MuToGeN wrote:

>> No, arrays can be passed (<input name="array[2]">,
>> for example), but not objects.

MS> And why does this work then?

MS> === SCRIPT ===
MS> <?php

MS> error_reporting(E_ALL);

MS> class AClass {

MS>     var $i = 0;

MS>     function AClass ($i = 0) {
MS>         //$this->display();
MS>     }

MS>     function increment() {
MS>         $this->i++;
MS>     }

MS>     function display() {
MS>         printf('Current value of $i is:  %s<br>', $this->i);
MS>     }
MS> }

MS> session_start();

MS> if (!isset($_SESSION['AClass'])) {
MS>     $a = & new AClass();
MS>     $_SESSION['AClass'] = & $a;
MS> }
MS> else {
MS>     $a = & $_SESSION['AClass'];
MS> }

$a->>increment();
$a->>display();

?>>


MS> === /SCRIPT ===



-- 
Best regards,
 MuToGeN                            mailto:[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to