|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2013-02-12 14:27 UTC] krakjoe@php.net
Description:
------------
This patch avoids stack overflows where recursion is present in __clone.
Test script:
---------------
<?php
class Cloneable {
public function __clone(){
return clone $this;
}
}
$c = new Cloneable();
$a = clone $c;
?>
Expected result:
----------------
Stack overflow
Actual result:
--------------
E_ERROR
Patches__clone-2.patch (last revision 2013-02-12 23:12 UTC by krakjoe@php.net)__clone.patch (last revision 2013-02-12 14:29 UTC by pthreads at pthreads dot org) Pull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 10:00:01 2025 UTC |
Not sure in what way the new patch resolves the clash. Doesn't it just move it from "$foo->__clone" towards "$foo->{'$__clone'}"?