php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73167 there is a bug in variable variables
Submitted: 2016-09-25 13:24 UTC Modified: 2016-09-25 19:31 UTC
From: karemmm21 at yahoo dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 7.0.11 OS: variable variables
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: karemmm21 at yahoo dot com
New email:
PHP Version: OS:

 

 [2016-09-25 13:24 UTC] karemmm21 at yahoo dot com
Description:
------------
$tirepr = 30;

$name = substr("tireqty",0,-3);
$xx = $name . "pr". "<br />";
echo $$xx;


// the result is Notice: Undefined variable: tirepr

Test script:
---------------
$tirepr = "30";

$name = substr("tireqty",0,-3);
$xx = $name . "pr". "<br />";
echo $$xx;


// the result is Notice: Undefined variable: tirepr

Expected result:
----------------
print 30 

Actual result:
--------------
 Notice: Undefined variable: tirepr

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-09-25 13:53 UTC] nikic@php.net
-Status: Open +Status: Not a bug
 [2016-09-25 13:53 UTC] nikic@php.net
You've included a "<br />" in the variable name -- probably it was supposed to go on the next line?
 [2016-09-25 19:31 UTC] yohgaki@php.net
https://3v4l.org/29Khi
Interestingly, HHVM fails. It may be 3v4l problem, though.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 18:00:02 2026 UTC