Bug #52311 [NEW]: PHP raises Fatal Error on not existent method invocation

From: Date: Mon, 12 Jul 2010 03:41:27 +0000
Subject: Bug #52311 [NEW]: PHP raises Fatal Error on not existent method invocation
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-152281@lists.php.net to get a copy of this message
From:             
Operating system: Any
PHP version:      5.3.2
Package:          *General Issues
Bug Type:         Bug
Bug description:PHP raises Fatal Error on not existent method invocation

Description:
------------
Invoking a method that doesn't exist raises a Fatal Error, and there is no
way to 
catch the exception.

Test script:
---------------
<?php

class A
{
    public function __construct()
    {
        \error_reporting(\E_ALL);
        \ini_set('display_errors', true);
        \ini_set('display_startup_errors', true);

        try { $this->_init(); } catch (\Exception $e) {echo "Catched!";}
    }
}

new A();


Expected result:
----------------
Catched!

Actual result:
--------------
Fatal error: Call to undefined method A::_init() in 
/srv/http/PHP/3/fatalerror.php on line 11

-- 
Edit bug report at http://bugs.php.net/bug.php?id=52311&edit=1
-- 
Try a snapshot (PHP 5.2):            http://bugs.php.net/fix.php?id=52311&r=trysnapshot52
Try a snapshot (PHP 5.3):            http://bugs.php.net/fix.php?id=52311&r=trysnapshot53
Try a snapshot (trunk):              http://bugs.php.net/fix.php?id=52311&r=trysnapshottrunk
Fixed in SVN:                        http://bugs.php.net/fix.php?id=52311&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=52311&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=52311&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=52311&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=52311&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=52311&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=52311&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=52311&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=52311&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=52311&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=52311&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=52311&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=52311&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=52311&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=52311&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=52311&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=52311&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=52311&r=mysqlcfg



Thread (2 messages)

« previous php.bugs (#152281) next »