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
 [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

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-02-23 17:04 UTC] cmouse at desteem dot org
Sorry, my bad.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 15 23:01:33 2025 UTC