File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / Zend / tests / bug48533.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:47:52 2012 UTC (13 years, 1 month ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

    1: --TEST--
    2: Bug #48533 (__callStatic is not invoked for private/protected methods)
    3: --FILE--
    4: <?php
    5: 
    6: class foo {
    7: 	private function a() {
    8: 		var_dump(1);	
    9: 	}
   10: 	public function b() {
   11: 		var_dump(2);
   12: 	}
   13: 	protected function c() {
   14: 		var_dump(3);
   15: 	}
   16: 	static function __callstatic($a, $b) {
   17: 		var_dump('__callStatic::'. $a);
   18: 	}
   19: 	public function __call($a, $b) {
   20: 		var_dump('__call::'. $a);
   21: 	}
   22: }
   23: 
   24: $x = new foo;
   25: $x->a();
   26: $x->b();
   27: $x->c();
   28: $x::a();
   29: $x::b();
   30: $x::c();
   31: 
   32: ?>
   33: --EXPECTF--
   34: %unicode|string%(9) "__call::a"
   35: int(2)
   36: %unicode|string%(9) "__call::c"
   37: %unicode|string%(15) "__callStatic::a"
   38: 
   39: Strict Standards: Non-static method foo::b() should not be called statically in %s on line %d
   40: int(2)
   41: %unicode|string%(15) "__callStatic::c"

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>