Doc #74630 [Ver->Csd]: Syntax error in example

From: Date: Mon, 22 May 2017 16:35:28 +0000
Subject: Doc #74630 [Ver->Csd]: Syntax error in example
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-14715@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74630&edit=1 ID: 74630 Updated by: cmb@php.net Reported by: ionut dot mihaescu at gmail dot com Summary: Syntax error in example -Status: Verified +Status: Closed Type: Documentation Problem Package: mongodb Operating System: Ubuntu 16.04 x64 PHP Version: 7.0.19 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. Fixed with <http://svn.php.net/viewvc?view=revision&revision=342493>. Previous Comments: ------------------------------------------------------------------------ [2017-05-22 12:06:16] ionut dot mihaescu at gmail dot com I miss typed : ... should and in a bracket "]" not in ")". Should be: ... should end in a bracket "]" not in ")". ------------------------------------------------------------------------ [2017-05-22 12:04:51] ionut dot mihaescu at gmail dot com Description: ------------ --- From manual page: http://www.php.net/mongodb-driver-query.construct --- The $options array should and in a bracket "]" not in ")". The example code will fail. $options = [ /* Only return the following fields in the matching documents */ 'projection' => [ 'title' => 1, 'article' => 1, ], /* Return the documents in descending order of views */ 'sort' => [ 'views' => -1 ], ); Expected result: ---------------- $options = [ /* Only return the following fields in the matching documents */ 'projection' => [ 'title' => 1, 'article' => 1, ], /* Return the documents in descending order of views */ 'sort' => [ 'views' => -1 ], ]; ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=74630&edit=1

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