xref: /PHP-5.6/tests/classes/private_006.phpt (revision ffd6f29e)
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
7class first {
8	private static function show() {
9		echo "Call show()\n";
10	}
11
12	public static function do_show() {
13		first::show();
14	}
15}
16
17first::do_show();
18
19class second extends first {
20}
21
22second::do_show();
23
24class third extends second {
25}
26
27third::do_show();
28
29class fail extends third {
30	static function show() {  // cannot be redeclared
31		echo "Call show()\n";
32	}
33}
34
35echo "Done\n";
36?>
37--EXPECTF--
38Call show()
39Call show()
40Call show()
41Done
42