mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
As of PHP 4.2.0, the behavoir changed. Even if a variable is not assigned
a value, it still exists in get_object_vars(). Essentially moved these docs in a <note>. This closes bug #17752. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@112618 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
adf2a15753
commit
fe8f7fadc6
1 changed files with 14 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- splitted from ./en/functions/classobj.xml, last change in rev 1.1 -->
|
||||
<refentry id="function.get-object-vars">
|
||||
<refnamediv>
|
||||
|
@ -14,10 +14,18 @@
|
|||
</methodsynopsis>
|
||||
<para>
|
||||
This function returns an associative array of defined object properties
|
||||
for the specified object <parameter>obj</parameter>. If variables
|
||||
declared in the class of which the <parameter>obj</parameter> is an
|
||||
instance, have not been assigned a value, those will not be returned
|
||||
in the array.
|
||||
for the specified object <parameter>obj</parameter>.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
In versions prior to PHP 4.2.0, if the variables declared in the class
|
||||
of which the <parameter>obj</parameter> is an instance, have not been
|
||||
assigned a value, those will not be returned in the array. In versions
|
||||
after PHP 4.2.0, the key will be assigned with a <constant>NULL</constant>
|
||||
value.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
<example>
|
||||
<title>Use of <function>get_object_vars</function></title>
|
||||
<programlisting role="php">
|
||||
|
@ -61,6 +69,7 @@ print_r(get_object_vars($p1));
|
|||
(
|
||||
[x] => 1.233
|
||||
[y] => 3.445
|
||||
[label] =>
|
||||
)
|
||||
|
||||
Array
|
||||
|
|
Loading…
Reference in a new issue