php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64203 private property of class modified by mysql_fetch_object
Submitted: 2013-02-13 10:35 UTC Modified: 2013-02-13 14:24 UTC
From: pelister dot 79 at gmail dot com Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 5.4.11 OS: Win XP
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: pelister dot 79 at gmail dot com
New email:
PHP Version: OS:

 

 [2013-02-13 10:35 UTC] pelister dot 79 at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.mysql-fetch-object#refsect1-function.mysql-fetch-object-notes
---

Private properties are accessed and values set with mysql_fetch_object, Can private properties be accessed outside the class?

Test script:
---------------
class myclass {
	
	private $option_name;
	private $option_value;
	private $option_id;
	
	function __construct( ) {
			echo "Data Created <br />";
	}
	function display( ) {
			echo "Name: $this->option_name, Value: $this->option_value, Id: $this->option_id <br />";
	}
}

/* connect to db */ 
$query = "SELECT * FROM simpleuser_options";

while( $row = mysql_fetch_object( $result, "myclass"))
	$row->display();




Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-02-13 11:50 UTC] pajoye@php.net
change mode and category for this report.
 [2013-02-13 11:50 UTC] pajoye@php.net
-Package: mSQL related +Package: MySQL related
 [2013-02-13 14:24 UTC] johannes@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


 [2013-02-13 14:24 UTC] johannes@php.net
-Status: Open +Status: Not a bug -Type: Security +Type: Bug
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 11:01:30 2024 UTC