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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

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: Wed Jul 16 08:01:29 2025 UTC