php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34100 register_globals overrides object assignment
Submitted: 2005-08-12 16:25 UTC Modified: 2005-08-12 16:42 UTC
From: michael at scribeofthenile dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 4.4.0 OS: GNU/Linux
Private report: No CVE-ID: None
 [2005-08-12 16:25 UTC] michael at scribeofthenile dot com
Description:
------------
While register_globals is enabled, if a GET parameter is passed with the same name as an object, the object assignation is ignored.

Reproduce code:
---------------
Access via "file.php?test=string"

$test->test = 'test';
var_dump($test);

Expected result:
----------------
object(stdClass)(1) { ["test"]=>  string(4) "test" }

Actual result:
--------------
string(6) "string"

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-12 16:42 UTC] tony2001@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

Try this too:
<?php
$t ="string"; 
$t->property ="test"; 
var_dump($t);
?>
PHP >= 5.x gives warning in this case.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 00:00:02 2026 UTC