[ create a new paste ] login | about

Link: http://codepad.org/9qhpl3qG    [ raw code | output | fork ]

PHP, pasted on Sep 4:
<?php
class StackExchange {
	public static $URL;
	protected static $code;
	private static $revenue;
	
	public static function exchange() {}
	
	protected static function stack() {}
	
	private static function overflow() {}
}

class StackOverflow extends StackExchange {
	public static function debug() {
		//Inherited static methods...
		self::exchange(); //Also works
		self::stack();    //Works
		self::overflow(); //But this won't
		
		//Inherited static properties
		echo self::$URL; //Works
		echo self::$code; //Works
		echo self::$revenue; //Fails
	}
}

StackOverflow::debug();
?>


Output:
1
2

Fatal error: Call to private method StackExchange::overflow() from context 'StackOverflow' on line 19


Create a new paste based on this one


Comments: