<?php
//error_reporting(-1);
error_reporting (E_ALL | E_STRICT);
set_error_handler ('test::php_error_handler');



class test
{
	public $a = 123;
	public $b = 222;
	public $c = 641;
	
	static function php_error_handler ($errno, $errstr, $errfile, $errline, $vars) {
	    //throw new Exception ("\n\n".'['.$errno.'] '.$errstr.' ('.strtr ($errfile, '\\', '/').', '.$errline.')'."\n\n");
		
		if (!empty($errno)) {
			echo $errno;
			echo "\n";
		}
		if (!empty($errstr)) {
			echo $errstr;
			echo "\n";
		}
		if (!empty($errfile)) {
			echo $errfile;
			echo "\n";
		}
		if (!empty($errline)) {
			echo $errline;
			echo "\n";
		}
		if (!empty($vars)) {
			print_r($vars);
			echo "\n";
		}
		
	}

	
	public function cry() {
		echo $this->a;
		echo "\n";
	}
	
	public function summ($a, $b) {
		
		if (!empty($a) and !empty($b)) {
			return $a + $b;
		} else {
			return $this->a + $this->b;
		}
	}
	
	
}



$z = new test();
$z->cry();
$z->a = 100;
$z->cry();
$x = $z->summ(0,0);

$y = $z->summ(3, 4);



var_dump($x);

var_dump($y);



error;