Doc #71878 [Com]: Error in documentation example
| From: | alexis_advance at hotmail dot com | Date: | Wed, 23 Mar 2016 21:02:15 +0000 |
| Subject: | Doc #71878 [Com]: Error in documentation example | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-13340@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=71878&edit=1
ID: 71878
Comment by: alexis_advance at hotmail dot com
Reported by: alexis_advance at hotmail dot com
Summary: Error in documentation example
Status: Closed
Type: Documentation Problem
Package: Scripting Engine problem
PHP Version: Irrelevant
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Thanks for you, requinix@php.net and cmb@php.net
Regards.
Previous Comments:
------------------------------------------------------------------------
[2016-03-23 11:15:02] cmb@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation better.
------------------------------------------------------------------------
[2016-03-23 11:14:17] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=338787
Log: fixed #71878 (Error in documentation example)
------------------------------------------------------------------------
[2016-03-22 09:47:24] requinix@php.net
https://3v4l.org/UpA4M
Needs to be updated for PHP 7's changes.
------------------------------------------------------------------------
[2016-03-22 09:43:37] alexis_advance at hotmail dot com
Description:
------------
---
From manual page: http://www.php.net/language.types.string
---
The example right below "It is also possible to access class properties using variables within
strings using this syntax." does not work as expected.
Test script:
---------------
Note: I just copied and pasted this script from the documentation.
<?php
class foo {
var $bar = 'I am bar.';
}
$foo = new foo();
$bar = 'bar';
$baz = array('foo', 'bar', 'baz', 'quux');
echo "{$foo->$bar}\n";
echo "{$foo->$baz[1]}\n";
?>
Expected result:
----------------
I am bar.
I am bar.
Actual result:
--------------
I am bar.
Notice: Array to string conversion in (filepath) on line 10
Notice: Undefined property: foo::$Array in (filepath) on line 10
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71878&edit=1