Login
Register
All class groups
Latest entries
Top 10 charts
Blog
Forums
Shop
Help
Login
Register
Additional Note
Search
All class groups
Latest entries
Top 10 charts
Blog
Forums
Shop
Help
Recommend
this page to a friend!
Simple Singleton
>
All threads
>
Additional Note
>
(Un) Subscribe thread alerts
Subject:
Additional Note
Summary:
__clone() issue
Messages:
2
Author:
Fabian Schmengler
Date:
2010-01-13 13:31:24
Update:
2010-01-14 14:00:17
1. Additional Note
Reply
Report abuse
Fabian Schmengler - 2010-01-13 13:31:24
Hi,
I am aware that this class is only for demonstration but it should be noted that the clone constructor has to be made private too, otherwise it is possible to create multiple instances like that: $instance2 = clone $instance;
Solution:
private function __clone() { }
2. Re: Additional Note
Reply
Report abuse
freedelta - 2010-01-14 14:00:17 -
In reply to
message 1
from Fabian Schmengler
Yes, you are right, thanks for this note.
About us
Advertise on this site
Site map
Newsletter
Statistics
Site tips
Privacy policy
Contact
Copyright (c)
Icontem
1999-2024
For more information send a message to
info at phpclasses dot org
.
image/svg+xml
image/svg+xml
Contact us using Messenger