forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix bug #61782 - __clone/__destruct do not match other methods when c…
…hecking access controls
- Loading branch information
Showing
6 changed files
with
64 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--TEST-- | ||
Bug #61782 (__clone/__destruct do not match other methods when checking access controls) | ||
--FILE-- | ||
<?php | ||
abstract class BaseClass { | ||
abstract protected function __clone(); | ||
} | ||
|
||
class MommasBoy extends BaseClass { | ||
protected function __clone() { | ||
echo __METHOD__, "\n"; | ||
} | ||
} | ||
|
||
class LatchkeyKid extends BaseClass { | ||
public function __construct() { | ||
echo 'In ', __CLASS__, ":\n"; | ||
$kid = new MommasBoy(); | ||
$kid = clone $kid; | ||
} | ||
public function __clone() {} | ||
} | ||
|
||
$obj = new LatchkeyKid(); | ||
echo "DONE\n"; | ||
--EXPECT-- | ||
In LatchkeyKid: | ||
MommasBoy::__clone | ||
DONE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters