xref: /PHP-7.0/tests/classes/private_006b.phpt (revision e5eb9530)
1--TEST--
2ZE2 A private method can be overwritten in a second derived class
3--SKIPIF--
4<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
5--FILE--
6<?php
7
8class first {
9	private function show() {
10		echo "Call show()\n";
11	}
12
13	public function do_show() {
14		$this->show();
15	}
16}
17
18$t1 = new first();
19$t1->do_show();
20
21class second extends first {
22}
23
24//$t2 = new second();
25//$t2->do_show();
26
27class third extends second {
28	private function show() {
29		echo "Call show()\n";
30	}
31}
32
33$t3 = new third();
34$t3->do_show();
35
36echo "Done\n";
37?>
38--EXPECTF--
39Call show()
40Call show()
41Done
42