php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27334 clone keyword vs __clone
Submitted: 2004-02-20 14:56 UTC Modified: 2005-09-22 13:55 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: trancer at trancer dot nl Assigned:
Status: Closed Package: Website problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: trancer at trancer dot nl
New email:
PHP Version: OS:

 

 [2004-02-20 14:56 UTC] trancer at trancer dot nl
Description:
------------
Had the following: fatal error: Cannot call __clone() method on objects - use 'clone $obj' instead.

Dig some digging, stumbled upon http://www.php.net/ChangeLog-5.php mentioning the following:

"Redesigned clone by adding a clone keyword (clone $obj) and copying all properties before __clone() is called. Also allows calling parent __clone function by using parent::__clone(). (Zeev, Andi)"

However the document http://www.php.net/zend-engine-2.php is in conflict with this mentioning a lot about __clone()

"An object copy is created by calling the object's __clone() method:"

Please fix the zend-engine-2 documentation.






Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-23 03:09 UTC] irchtml@php.net
Reclassifying as a php.net website problem as the zend-engine-2.php file is under phpweb/.
 [2005-09-22 13:43 UTC] sniper@php.net
Reclassified as documentation problem, that information SHOULD be in the manual!

 [2005-09-22 13:55 UTC] vrana@php.net
http://www.php.net/zend-engine-2.php currently shows http://www.php.net/manual/en/language.oop5.php where is everything documented properly.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 26 21:00:02 2025 UTC