summaryrefslogtreecommitdiff
path: root/Zend/tests/access_modifiers_010.phpt
blob: 07a1b594deb167a73b63772f5c527293ae5d2927 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
--TEST--
Testing visibility of methods
--FILE--
<?php

class d {
	private function test2() {
		print "Bar\n";
	}
}

abstract class a extends d {
	public function test() {
		$this->test2();
	}
}

abstract class b extends a {
}

class c extends b {
	public function __construct() {
		$this->test();
	}	
}

new c;

?>
--EXPECTF--
Fatal error: Uncaught exception 'Error' with message 'Call to private method d::test2() from context 'a'' in %s:%d
Stack trace:
#0 %s(%d): a->test()
#1 %s(%d): c->__construct()
#2 {main}
  thrown in %s on line %d