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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Sat Mar 15 11:01:29 2025 UTC