Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

Disallow cloning in PHP?

$
0
0

Hello,

 

Is there any way to disallow the use of "clone " for an object?

 

What I mean is, let's say I have a class named "user"

I am able to clone the object ;

$student = new user();

$teacher = clone $student;

 

Is there any keyword that does not allow me to clone the "$student" object?

 

Thank you in advance


Viewing all articles
Browse latest Browse all 13200

Trending Articles