Bug #63854 [Opn]: PHP 5.3.15
| From: | spaghetti dot coder dot ru at gmail dot com | Date: | Wed, 26 Dec 2012 14:35:31 +0000 |
| Subject: | Bug #63854 [Opn]: PHP 5.3.15 | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-9320@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=63854&edit=1
ID: 63854
User updated by: spaghetti dot coder dot ru at gmail dot com
Reported by: spaghetti dot coder dot ru at gmail dot com
Summary: PHP 5.3.15
Status: Open
Type: Bug
Package: Documentation problem
Operating System: OS X 1.7.5, Win 7
PHP Version: 5.3Git-2012-12-26 (Git)
Block user comment: N
Private report: N
New Comment:
In the same manner we can damage $this variable in a class
php > class MyClass {
php { public function __construct() {
php { // ${'this'} = 'broken'; // will give us a fatal error
php { $breakThis = 'this';
php { $$breakThis = 'broken'; // but this will serve fine
php { var_dump($this);
php { }
php { }
php > new MyClass();
string(6) "broken"
Previous Comments:
------------------------------------------------------------------------
[2012-12-26 12:33:40] spaghetti dot coder dot ru at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/language.variables.basics
---
It's still possible to create a variable violation the [a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*
rule
Test script:
---------------
<?php
// $*noWay = ''; // PHP Parse error: parse error, expecting
T_VARIABLE' or
'$'' in php shell code on line 1
$hackIt = '*iAmASiPointer!!!';
$$hackIt = 'Howdy';
echo $$hackIt;
echo "\n";
var_dump(get_defined_vars());
Expected result:
----------------
$$hackIt = 'Howdy'; line was supposed to trigger a PHP Parse error
Actual result:
--------------
Outputs:
Howdy
array(10) {
...
["hackIt"]=>
string(17) "*iAmASiPointer!!!"
["*iAmASiPointer!!!"]=>
string(4) "Howdy"
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=63854&edit=1