language/types/object.xml
4c4b82965384d55f5c3efb1ffa80615acd98a737
...
...
@@ -43,11 +43,11 @@ $bar->do_foo();
43
43
<para>
44
44
If an <type>object</type> is converted to an <type>object</type>, it is not
45
45
modified. If a value of any other type is converted to an
46
-
<type>object</type>, a new instance of the <literal>stdClass</literal>
46
+
<type>object</type>, a new instance of the <classname>stdClass</classname>
47
47
built-in class is created. If the value was &null;, the new instance will be
48
48
empty. An <type>array</type> converts to an <type>object</type> with properties
49
-
named by keys and corresponding values, with the exception of numeric keys which
50
-
will be inaccessible unless iterated.
49
+
named by keys and corresponding values. Note that in this case before PHP 7.2.0 numeric keys
50
+
have been inaccessible unless iterated.
51
51
</para>
52
52

53
53
<informalexample>
...
...
@@ -55,8 +55,8 @@ $bar->do_foo();
55
55
<![CDATA[
56
56
<?php
57
57
$obj = (object) array('1' => 'foo');
58
-
var_dump(isset($obj->{'1'})); // outputs 'bool(false)'
59
-
var_dump(key($obj)); // outputs 'int(1)'
58
+
var_dump(isset($obj->{'1'})); // outputs 'bool(true)' as of PHP 7.2.0; 'bool(false)' previously
59
+
var_dump(key($obj)); // outputs 'string(1) "1"' as of PHP 7.2.0; 'int(1)' previously
60
60
?>
61
61
]]>
62
62
</programlisting>
63
63