PHP 4.0 Bug #7347: PHP does not report fatal errors
| From: | cjw at cwible dot com | Date: | Thu, 19 Oct 2000 18:02:22 +0000 |
| Subject: | PHP 4.0 Bug #7347: PHP does not report fatal errors | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-35555@lists.php.net to get a copy of this message | ||
From: cjw@cwible.com
Operating system: RedHat Linux 6.0
PHP version: 4.0.3pl1
PHP Bug Type: Unknown/Other Function
Bug description: PHP does not report fatal errors
When I run the code below, as it stands. I get the following output - which is clearly incorrect!
Cullin
Performing test A:...
testA:
forceError: called
holder->test() called!
testPrint: a: Param 2
testPrint: b: Param 2
Performing test B:...
testB: 1
forceError: called
Fatal error: Call to a member function on a non-object in /usr/home/cjw/www/function.php on line 36
<?
/* try changing the values for testA and testB */
/* from true to false. You will find that when */
/* testA is called with a false or undefuned */
/* value, PHP will not report any errors */
/* and the testPrint will print incorrect */
/* parameters. - Go figure! cwible@cwible.com */
print "<B>Performing test A:...<BR></B>";
testA(getHashVal('false'));
print "<P>";
print "<B>Performing test B:...<BR></B>";
print testB(getHashVal('true'));
/* create a new object, then call forceError */
function testA (&$var_a) {
print "testA: $var_a<BR>";
$obj = new holder();
forceError();
};
/* create a new object, then call forceError */
/* the only difference here is that $var_a */
/* is not a reference - go figure */
function testB ($var_a) {
print "testB: $var_a<BR>";
$obj = new holder();
forceError();
};
/* call a method on an undefined object */
function forceError () {
print "forceError: called<BR>\n";
$notanobject->test();
testPrint("Param 1","Param 2");
};
/* just print our parameters */
function testPrint($a,$b) {
print "testPrint: a: " . $a . "<BR>\n";
print "testPrint: b: " . $b . "<BR>\n";
};
/* return a value from a hash */
function getHashVal($var) {
$hash['true'] = true;
unset($hash['false']);
return($hash[$var]);
}
/* a class that just prints text */
class holder {
function test() {
print "<B>holder->test() called!</B><BR>\n";
return;
}
};
?>
--
Edit Bug report at: http://bugs.php.net/?id=7347&edit=1