php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44227 PHP parses string inside quotes as PHP code
Submitted: 2008-02-23 16:56 UTC Modified: 2008-02-23 17:04 UTC
From: cmouse at desteem dot org Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.2.5 OS: Windows XP x64
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: cmouse at desteem dot org
New email:
PHP Version: OS:

 

 [2008-02-23 16:56 UTC] cmouse at desteem dot org
Description:
------------
For some reason, php seems to think that code inside single or double quotes spanned over several lines is source code. 

Reproduce code:
---------------
<?php

$lang = 'fi';

$str = '
<?php

class Test_Me_Here_' . $lang . ' {

}';


echo $str

?>

Expected result:
----------------
> php test.php
class Test_Me_Here_fi {

}
>


Actual result:
--------------
>php test.php
PHP Parse error:  syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting '{' in C:\eclipse\workspace\luuppi\vendors\Luuppi\test.php on line 7
>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-02-23 17:04 UTC] cmouse at desteem dot org
Sorry, my bad.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 02 00:01:30 2024 UTC