xref: /PHP-5.6/Zend/tests/closure_033.phpt (revision 610c7fbe)
1--TEST--
2Closure 033: Dynamic closure property and private function
3--FILE--
4<?php
5
6class Test {
7	public $func;
8	function __construct() {
9		$this->func = function() {
10			echo __METHOD__ . "()\n";
11		};
12	}
13	private function func() {
14		echo __METHOD__ . "()\n";
15	}
16}
17
18$o = new Test;
19$f = $o->func;
20$f();
21$o->func();
22
23?>
24===DONE===
25--EXPECTF--
26Test::{closure}()
27
28Fatal error: Call to private method Test::func() from context '' in %sclosure_033.php on line %d
29