Doc #71878 [Opn->Csd]: Error in documentation example

From: Date: Wed, 23 Mar 2016 11:15:03 +0000
Subject: Doc #71878 [Opn->Csd]: Error in documentation example
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-13338@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 Updated by: cmb@php.net Reported by: alexis_advance at hotmail dot com Summary: Error in documentation example -Status: Open +Status: Closed Type: Documentation Problem Package: Scripting Engine problem PHP Version: Irrelevant -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [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&amp;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

« previous php.doc.bugs (#13338) next »