Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.6.0a3

Bug #16158 Fatal error: Cannot call __clone() method on objects
Submitted: 2009-04-29 19:15 UTC
From: kenorb Assigned: arpad
Status: Closed Package: PHP_Compat (version 1.6.0a2)
PHP Version: 5.2.9 OS: Win Seven
Roadmaps: 1.6.0a3    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 26 + 17 = ?

 
 [2009-04-29 19:15 UTC] kenorb (Rafal Wie.)
Description: ------------ Fatal error: Cannot call __clone() method on objects - use 'clone $obj' instead in Compat\Function\clone.php on line 31 Actual result: -------------- Code: if (method_exists($object, '__clone')) { $object->__clone(); }

Comments

 [2009-04-30 01:48 UTC] aidan (Aidan Lister)
From this bug report, it looks like they've made __clone private and removed PHP5's clone() function? If that's the case then there's no backward compatible solution ... thoughts?
 [2009-05-01 21:59 UTC] hm2k (James Wade)
What code are you using to replicate this error?
 [2009-05-07 01:12 UTC] arpad (Arpad Ray)
-Status: Open +Status: Closed -Assigned To: +Assigned To: arpad
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. It's not just private, you can't call it from within the same class even. Oddly using a variable function call, e.g. $func = '__clone'; $object->$func(); does work, I've committed that dodge but we should keep an eye on this.