cvs: ZendEngine2 /tests access_modifiers_011.phpt

"Andrei Zmievski" <[email protected]>
Newsgroups gmane.comp.php.cvs.zend
Message-ID <cvsandrei1231367845@cvsserver>
andrei		Wed Jan  7 22:37:25 2009 UTC

  Modified files:              
    /ZendEngine2/tests	access_modifiers_011.phpt 
  Log:
  MFB
  
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/access_modifiers_011.phpt?r1=1.1&r2=1.2&diff_format=u
Index: ZendEngine2/tests/access_modifiers_011.phpt
diff -u /dev/null ZendEngine2/tests/access_modifiers_011.phpt:1.2
--- /dev/null	Wed Jan  7 22:37:25 2009
+++ ZendEngine2/tests/access_modifiers_011.phpt	Wed Jan  7 22:37:25 2009
@@ -0,0 +1,39 @@
+--TEST--
+__call() for private/protected methods
+--FILE--
+<?php
+
+class A {
+	private   $var1 = 'var1 value';
+	protected $var2 = 'var2 value';
+
+	private function func1()
+	{
+		return "in func1";
+	}
+	protected function func2()
+	{
+		return "in func2";
+	}
+	public function __get($var)
+	{
+		return $this->$var;
+	}
+	public function __call($func, array $args = array())
+	{
+		return call_user_func_array(array($this, $func), $args);
+	}
+}
+
+$a = new A();
+echo $a->var1,"\n";
+echo $a->var2,"\n";
+echo $a->func1(),"\n";
+echo $a->func2(),"\n";
+
+?>
+--EXPECTF--	
+var1 value
+var2 value
+in func1
+in func2



-- 
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.