xref: /PHP-7.2/Zend/tests/bug61782.phpt (revision d03900dc)
1--TEST--
2Bug #61782 (__clone/__destruct do not match other methods when checking access controls)
3--FILE--
4<?php
5 abstract class BaseClass {
6        abstract protected function __clone();
7    }
8
9    class MommasBoy extends BaseClass {
10        protected function __clone() {
11            echo __METHOD__, "\n";
12        }
13    }
14
15    class LatchkeyKid extends BaseClass {
16        public function __construct() {
17            echo 'In ', __CLASS__, ":\n";
18            $kid = new MommasBoy();
19            $kid = clone $kid;
20        }
21        public function __clone() {}
22    }
23
24    $obj = new LatchkeyKid();
25echo "DONE\n";
26--EXPECT--
27In LatchkeyKid:
28MommasBoy::__clone
29DONE
30