fatal-error

PHP Fatal error: Cannot redeclare class

≯℡__Kan透↙ 提交于 2019-11-26 00:44:04
问题 Does anyone know what can cause this problem? PHP Fatal error: Cannot redeclare class 回答1: It means you've already created a class. For instance: class Foo {} // some code here class Foo {} That second Foo would throw the error. 回答2: You have a class of the same name declared more than once. Maybe via multiple includes. When including other files you need to use something like include_once "something.php"; to prevent multiple inclusions. It's very easy for this to happen, though not always

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo

纵饮孤独 提交于 2019-11-26 00:19:28
问题 I was trying to run a sample code While launching the application in the android 1.5 emulator , I got these errors.... Any one have some hint..? ERROR from LogCat: 01-13 02:28:08.392: ERROR/AndroidRuntime(2888): FATAL EXCEPTION: main 01-13 02:28:08.392: ERROR/AndroidRuntime(2888): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.s.android.test/com.s.android.test.MainActivity}: java.lang.ClassNotFoundException: com.s.android.test.MainActivity in loader dalvik.system

How do I catch a PHP Fatal Error

让人想犯罪 __ 提交于 2019-11-25 22:55:22
问题 I can use set_error_handler() to catch most PHP errors, but it doesn\'t work for fatal ( E_ERROR ) errors, such as calling a function that doesn\'t exist. Is there another way to catch these errors? I am trying to call mail() for all errors and am running PHP 5.2.3. 回答1: Log fatal errors using register_shutdown_function , which requires PHP 5.2+: register_shutdown_function( "fatal_handler" ); function fatal_handler() { $errfile = "unknown file"; $errstr = "shutdown"; $errno = E_CORE_ERROR;

PHP Fatal error: Using $this when not in object context

我们两清 提交于 2019-11-25 22:41:45
问题 I\'ve got a problem: I\'m writing a new WebApp without a Framework. In my index.php I\'m using: require_once(\'load.php\'); And in load.php I\'m using require_once(\'class.php\'); to load my class.php . In my class.php I\'ve got this error: Fatal error: Using $this when not in object context in class.php on line ... (in this example it would be 11) An example how my class.php is written: class foobar { public $foo; public function __construct() { global $foo; $this->foo = $foo; } public

Weird PHP error: 'Can't use function return value in write context'

十年热恋 提交于 2019-11-25 21:52:00
I'm getting this error and I can't make head or tail of it. The exact error message is: Fatal error: Can't use function return value in write context in /home/curricle/public_html/descarga/index.php on line 48 Line 48 is: if (isset($_POST('sms_code') == TRUE ) { Anybody knows what's going on??? PS Here's the full function, in case it helps: function validate_sms_code() { $state = NOTHING_SUBMITED; if (isset($_POST('sms_code') == TRUE ) { $sms_code = clean_up($_POST('sms_code')); $return_code = get_sepomo_code($sms_code); switch($return_code) { case 1: //no error $state = CORRECT_CODE; break;