php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28155 clone reserved word? T_CLONE parse error
Submitted: 2004-04-26 14:02 UTC Modified: 2004-09-14 23:21 UTC
From: fbn79 at libero dot it Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5* OS: *
Private report: No CVE-ID: None
 [2004-04-26 14:02 UTC] fbn79 at libero dot it
Description:
------------
I'm not sure if it's a buf or if the function name "clone" was reserved in php5. The parse errore exist in RC1 and RC2 whith or without Compatibility Mode OFF or ON

Reproduce code:
---------------
class myclass{

function &clone()
    {
        ....
    }
}

Actual result:
--------------
Parse error: parse error, unexpected T_CLONE, expecting T_STRING in ... on line ...

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-26 16:45 UTC] derick@php.net
It's a keyword now, and not a bug (As it's expected behavior)
 [2004-04-26 16:46 UTC] derick@php.net
Updated summary to make it easier to find for other people running into this new behavior.
 [2004-06-03 11:05 UTC] ben at jazzyphones dot com
Hi

I am getting the same behaviour but am not sure how to fix this based on the above comments.  You say you have updated the summary, can you link to this summary?

Regards
 [2004-09-14 21:41 UTC] nospam0 at malkusch dot de
How about turning the keyword off, when 
zend.ze1_compatibility_mode is used? There might be some 
PHP4 classes (and I had one of them) which have a clone 
method and are broken since PHP5.
 [2004-09-14 23:21 UTC] helly@php.net
impossible
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 06 06:01:31 2024 UTC