#44111 [Opn->Bgs]: get_object_vars() produces different output with 5.2.3 and 5.2.5
ID: 44111
Updated by: jani@php.net
Reported By: leandro dot rhcp99 at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Ubuntu 7.10
PHP Version: 5.2.5
New Comment:
change the "private" to "public" and it works like you expect. No bug
here.
Previous Comments:
------------------------------------------------------------------------
[2008-02-13 17:05:56] leandro dot rhcp99 at gmail dot com
Description:
------------
I'm php user and move my php projects from 5.2.3 to 5.2.5. In this
changing I've got some problems on function get_object_vars. And seeing
the changelog (http://bugs.php.net/bug.php?id=40757) I've noted that
have some changes on this function.
Reproduce code:
---------------
class Modelo {
public function __construct() {
echo "Construtor Teste:<br />";
echo "<pre>";
print_r(array_keys(get_object_vars($this)));
echo "</pre>";
}
}
class Teste extends Modelo {
//Atributte
private $atributo1;
private $atributo2;
public function setAtributo1($atributo1) {
$this->atributo1 = $atributo1;
}
public function getAtributo1(){
return $this->atributo1;
}
public function setAtributo2($atributo2) {
$this->atributo2 = $atributo2;
}
public function getAtributo2(){
return $this->atributo2;
}
}
$objeto = new Teste();
Expected result:
----------------
Array
(
[0] => atributo1
[1] => atributo2
)
Actual result:
--------------
Array
(
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44111&edit=1
Thread (2 messages)