Hello, I have a question or two about singleton design pattern in php..
First of all, does having a single static instance of a class mean that you can get a reference to that class in two separate webpages and in the second page, it still contain all the data from the first page. If so, this would help me out a lot.
Secondly, if this is possible, could someone give me some
example code for implementing the singleton design pattern
for a class in php. I have looked online, and found a few
examples but never was able to get any of them to work.
Thirdly, if the first is possible, are there any drawbacks to doing this.
Thanks for any input,
Netooi
First of all, does having a single static instance of a class mean that you can get a reference to that class in two separate webpages and in the second page, it still contain all the data from the first page. If so, this would help me out a lot.
Secondly, if this is possible, could someone give me some
example code for implementing the singleton design pattern
for a class in php. I have looked online, and found a few
examples but never was able to get any of them to work.
Thirdly, if the first is possible, are there any drawbacks to doing this.
Thanks for any input,
Netooi