freelanceprogrammers.org Forum Index » PHP
Multitasking Enviornment in PHP
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@...
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
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
China Wholesale - Electronics Products
Character Studio - Tutorials and Help







