It's a fine time to leave me loose wheel (ie. the Linux group name) ... but we're going to let the Warning ... " . $errstr . " ... that resulted from ...
" . str_replace("
", "<br>", $lines[-1 + $errline]) . " /" . "/ at line " . $errline . "
... through, okay?!
";
} else {
throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
}
}
$oerrh = set_error_handler("my\\name\\exception_error_handler");
function catchException($e) {
// Do some stuff ... via ... http://php.net/manual/en/function.set-exception-handler.php ... thanks
try {
// ... normal exception stuff goes here
print $undefined; // This is the underlying problem
} catch (Exception $e) {
print get_class($e)." thrown within the exception handler. Message: ".$e->getMessage()." on line ".$e->getLine();
}
}
$oeh = set_exception_handler('my\name\catchException');
class MyClass {}
function myfunction() {}
function strlen($inc) { return (0 - \strlen($inc)); }
const MYCONST = 1;
echo "Talking about PHP NamespaceTalking about PHP Namespace
";
$a = new MyClass;
$c = new \my\name\MyClass; // see "Global Space" section
echo "\strlen('hello') = " . \strlen('hello') . '
';
echo "namespace\strlen('hello') = " . namespace\strlen('hello') . '
';
echo "__NAMESPACE__ . '\strlen(\"hello\")' equates to " . __NAMESPACE__ . "\strlen(\"hello\") = " . strlen("hello") . '
';
$a = \strlen('hello'); // see "Using namespaces: fallback to global
// function/constant" section
//echo "\strlen('hello') = " . $a . '
';
$d = namespace\MYCONST; // see "namespace operator and __NAMESPACE__
// constant" section
echo "namespace\MYCONST = '" . constant($d) . "'
";
$d = __NAMESPACE__ . '\MYCONST';
echo "__NAMESPACE__ . '\MYCONST' equates to " . __NAMESPACE__ . "\MYCONST = " . constant($d) . '
'; // see "Namespaces and dynamic language features" section
echo "
";
?>