freelanceprogrammers.org Forum Index » PHP

Multitasking Enviornment in PHP


Goto page Previous  1, 2
View user's profile Post To page top
jms1609 Posted: Sun Sep 04, 2005 6:28 am


Joined: 11 May 2005

Posts: 5
Multitasking Enviornment in PHP
> Probably he`s talking about linked lists ... If so an approach in php
> would be the OO one:
>
> class List {
>
> var previous;
> var next;
> var contents;
>
> function List ( $p, $n, $c) {
> $this->previous = $p;
> $this->next = $n;
> $this->contents = $c;
> }
>

PHP is different than C, when you do:
$this->previous = $p
you get 2 differents objects. The original is $p and the new one on
$this->previous.
If you change $p, $this->previous will not be changed.

you must do something like:

function List ( &$p, &$n, $c) {
$this->previous &= $p;
$this->next &= $n;
$this->contents = $c;
}

to get the same object in both places... But I`m not sure...

--
José Miguel Santibáñez
jms@...
Reply with quote
Send private message
Goto page Previous  1, 2
Post new topic Reply to topic
Display posts from previous:   
 

All times are GMT
Page 2 of 2
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
China Wholesale - Electronics Products
Character Studio - Tutorials and Help