[TYPO3] [TYPO3-dev] Problems with a deprecated php function
Ivan Gomez Rodriguez
igomez at igalia.com
Fri Dec 14 12:38:29 CET 2007
I'm trying to use exceptions in my extensions for several reasons and
uncaugth exceptions have a bad behaviour, generating blank pages instead
normal fatal error message.
I think this problem is derived from use of deprecated function
call_user_method in class.tslib_content.php
Following code is not succesful :
class test
{
function foo()
{
throw new Exception('bar');
}
}
try {
$a = new test();
call_user_method('foo',$a);
} catch (Exception $e) {
echo $e->getMessage();
}
//Expected result: bar
Result in web :
Warning: call_user_method() [function.call-user-method]: Unable to call
foo() in ....
Result in CLI :
Notice: call_user_method(): This function is deprecated, use the
call_user_func variety with the array(&$obj, "method") syntax instead in
/home/igalia/igomez/TMP/TESTING_EXCEPTIONS/prueba1.php on line 16
bar
In CLI seems work but not in web.
Does know somebody what can i do for resolv that? Some php configuration
change ?
I think the best could be use another callbacking function like
call_user_func or call_user_func_array but i don't like to make this
important change in TYPO3 core .
------------------------
Iván Gómez Rodríguez
Computer Science Engineer
mailto:igomez at igalia.com
More information about the TYPO3-english
mailing list