php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34123 $GLOBALS variable doesn't get printed if used only once
Submitted: 2005-08-13 14:51 UTC Modified: 2005-08-13 14:57 UTC
From: ondrej at sury dot org Assigned:
Status: Wont fix Package: Scripting Engine problem
PHP Version: 4.4.0 OS: Linux
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: ondrej at sury dot org
New email:
PHP Version: OS:

 

 [2005-08-13 14:51 UTC] ondrej at sury dot org
Description:
------------
$GLOBALS variable is not printed out if:

- used from inside string
- used only once

Code works fine in PHP5.

Reproduce code:
---------------
<?php
$file = 'test';
echo __LINE__."${GLOBALS['file']}"."\n";
?>


Expected result:
----------------
3test

Actual result:
--------------
3

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-13 14:52 UTC] ondrej at sury dot org
Maybe I should another test case:

Reproduce code:
---------------
<?php
$file = 'test';
echo __LINE__."${GLOBALS['file']}\n";
echo __LINE__.$GLOBALS['file']."\n";
?>

Expected result:
----------------
3test
4test

Actual result:
--------------
3test
4test

Ie. it works as it should.
 [2005-08-13 14:57 UTC] tony2001@php.net
Works fine in PHP5.
I doubt that it's going to change in 4.4.0 ever.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 04:01:28 2024 UTC