[ 
https://issues.apache.org/jira/browse/THRIFT-2981?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14710627#comment-14710627
 ] 

Hudson commented on THRIFT-2981:
--------------------------------

SUCCESS: Integrated in Thrift #1647 (See 
[https://builds.apache.org/job/Thrift/1647/])
THRIFT-2981: IDL with no namespace produces unparsable PHP (jfarrell: rev 
6949b7c96933da182fde5e40b6c493eb054a7672)
* compiler/cpp/src/generate/t_php_generator.cc


> IDL with no namespace produces unparsable PHP
> ---------------------------------------------
>
>                 Key: THRIFT-2981
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2981
>             Project: Thrift
>          Issue Type: Bug
>          Components: PHP - Compiler
>    Affects Versions: 0.9.2
>         Environment: all
>            Reporter: Randy Abernethy
>            Assignee: Randy Abernethy
>            Priority: Minor
>             Fix For: 0.9.3
>
>         Attachments: 0001-php-gen-namespace-fix.patch
>
>
> Compiling IDL for PHP without a namespace like:
> {noformat}
> service hi {
>      void myFunc()
> }
> {noformat}
> generates hi.php with this at the top:
> {noformat}
> namespace ; 
> {noformat}
>  which causes PHP to produce:
> {noformat}
> PHP Parse error:  syntax error, unexpected ';', expecting identifier 
> (T_STRING) or \\\\ (T_NS_SEPARATOR) or '{' in ... on line 2
> {noformat}
> The compiler is generating the namespace statement even when there isn't one, 
> which blows up the PHP interpreter. Patch supresses service and type file 
> output of namespace unless there actually is one.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to