ZF-12155: Zend_Reflection_File doesn't handle complex parsed variable syntax properly

Issue Type: Bug Created: 2012-04-16T03:58:01.000+0000 Last Updated: 2012-05-14T12:47:52.000+0000 Status: Resolved Fix version(s): - 1.12.0 (27/Aug/12)

Reporter: Facundo Cabrera (facundo) Assignee: Adam Lundrigan (adamlundrigan) Tags: - Zend_Reflection

Related issues: - ZF2-301

Attachments: - ZF-12155_fix.patch


Zend_Reflection_File::_reflect() doesn't handle T_CURLY_OPEN | T_DOLLAR_OPEN_CURLY_BRACES as $openBraces given a parsing error.

I fixed the problem adding:

class: Zend_Reflection_File 339: switch ($type) { 340: // Special curly open situations 341: case T_CURLY_OPEN | T_DOLLAR_OPEN_CURLY_BRACES : 342: $openBraces++; 343: continue;


Posted by Adam Lundrigan (adamlundrigan) on 2012-05-08T19:29:50.000+0000

Can you provide a sample of code which causes Zend_Reflection_File to misbehave?

Posted by Facundo Cabrera (facundo) on 2012-05-09T11:17:39.000+0000

function test ( ) { $hello = 'hello'; $world = 'world';

$phrase = "{$hello} {$world}"; }

function test2 () { // you wont see this function after parsing because {$ doesn't match a common { but } does. }

Posted by Adam Lundrigan (adamlundrigan) on 2012-05-14T11:28:16.000+0000

Attached reproducing unit test

Posted by Adam Lundrigan (adamlundrigan) on 2012-05-14T12:19:52.000+0000

Attached fix and updated test

Posted by Adam Lundrigan (adamlundrigan) on 2012-05-14T12:24:05.000+0000

Fixed in trunk (1.12.0): r24803

Posted by Adam Lundrigan (adamlundrigan) on 2012-05-14T12:41:58.000+0000

No ZF2 PR issued, as this feature is incomplete in ZF2. See:…

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.