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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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

Add a Patch

Pull Requests

Add a Pull Request

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: Thu Apr 25 23:01:29 2024 UTC