Req #67312 [NEW]: type hinting exception handling
| From: | bhasker dot t dot an at gmail dot com | Date: | Tue, 20 May 2014 19:02:51 +0000 |
| Subject: | Req #67312 [NEW]: type hinting exception handling | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-185877@lists.php.net to get a copy of this message | ||
From: bhasker dot t dot an at gmail dot com
Operating system: windows
PHP version: 5.4.28
Package: *General Issues
Bug Type: Feature/Change Request
Bug description:type hinting exception handling
Description:
------------
class a {
protected function method_a(someClass $obj)
{
/// some code
}
}
$a = new a();
$a->method_a('hellow');
//this throws an error
Test script:
---------------
class a {
protected function method_a(someClass $obj)
{
/// some code
}
}
$a = new a();
$a->method_a('hellow');
//this throws an error
Expected result:
----------------
could be grate if there is possiblity to write like
class a {
protected function method_a(someClass $obj) throws someException
{
/// some code
}
}
try {
$a = new a();
$a->method_a('hellow');
}catch (someException $e){
//catch exception
}
Actual result:
--------------
throwing fatal error
--
Edit bug report at https://bugs.php.net/bug.php?id=67312&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=67312&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=67312&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=67312&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=67312&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=67312&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=67312&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=67312&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=67312&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=67312&r=support
Expected behavior: https://bugs.php.net/fix.php?id=67312&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=67312&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=67312&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=67312&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=67312&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=67312&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=67312&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=67312&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=67312&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=67312&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=67312&r=mysqlcfg