summaryrefslogtreecommitdiff
path: root/Zend/tests/exception_014.phpt
blob: cee08e1d58becaae66b93d33796c7f4712443683 (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
--TEST--
Exceptions on improper access to static class properties
--FILE--
<?php
class C {
	private $p = 0;
}

$x = new C;
try {
	var_dump($x->p);
} catch (Error $e) {
	echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n";
}

var_dump($x->p);
?>
--EXPECTF--
Exception: Cannot access private property C::$p in %sexception_014.php on line %d

Fatal error: Uncaught exception 'Error' with message 'Cannot access private property C::$p' in %sexception_014.php:%d
Stack trace:
#0 {main}
  thrown in %sexception_014.php on line %d