php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15228 variable variable spacing
Submitted: 2002-01-25 17:18 UTC Modified: 2002-07-16 01:25 UTC
From: philip at cornado dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.0CVS-2002-01-25 OS: n/a
Private report: No CVE-ID: None
 [2002-01-25 17:18 UTC] philip at cornado dot com
The following should result in a parse error:

  $foo = 'bar';
  $bar = 'hello';

  print $      $foo; // hello
  print $$foo;       // hello

Instead, 'hello' is printed both times.




Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-25 17:29 UTC] yohgaki@php.net
Confirmed with ZE2 and ZE1 (PHP4.0.6)
 [2002-06-29 03:56 UTC] andi@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

This isn't a bug but how PHP has always worked.
Changing this behavior isn't really feasible because of the way the parser works. I do suggest however that you use $$foo because the spaces are pretty ugly.

 [2002-07-16 01:25 UTC] philip@php.net
It's not a bug but it's a little weird, that's all :)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Sep 16 18:01:30 2024 UTC