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
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: 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: Thu Oct 08 10:00:01 2026 UTC