| Summary: | code assisting in a catch statement does not take in account namespaces | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | aikeleer |
| Component: | PDT | Assignee: | PHP Core <php.core-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P2 | CC: | silviya, zhaozhongwei, zulus |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows Server 2003 | ||
| Whiteboard: | |||
Hi
Can you describe the steps to reproduce this,for example
1.have the following content in php
{
}
catch(\Exception| $e)//cursor
{
}
2 calll CA
3 Results in a fatal error.
Thanks
Hi I guess when you run the code you get fatal error ,right? Example code:
This is a working version:
<?php
namespace example;
class Bla
{
function __construct()
{
try
{
// something which throws an Exception
}
catch(\Exception $e)
{
echo "bla";
}
}
}
$bla = new Bla();
?>
Now for the Assist functionality:
I type
<?php
namespace exmaple;
class Bla
{
function __construct()
{
try
{
// function which throws exception
}
catch ([CURSOR, now type ctrl+space, choose Exception, press Enter]
The suggestion puts a normal 'Exception' there, while it should be a '\Exception'.
I really hope this is a bit more clear. :)
fixed in head reopen it,because now it only works for the code:
<?php
namespace exmaple;
class Bla
{
function __construct()
{
try
{
// function which throws exception
}
catch ([CURSOR, now type ctrl+space, choose Exception, press Enter] $e){
}
}
}
?>
This works correctly with 3.3.0 Verified. Closing |
Build Identifier: 20100527-0614 When coding inside a Namespace and using a try{ } catch-block, code assist forgets my namespace. Reproducible: Always Steps to Reproduce: For example: namespace foo; This should be suggested at the catch phrase: try { { catch(\Exception $e) { } But this is suggested: try { } catch(Exception $e) { } While this results in a fatal error.