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
Have you experienced this issue?
Rate the importance of this bug to you:

 [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-2020 The PHP Group
All rights reserved.
Last updated: Sat Dec 05 06:01:23 2020 UTC