Doc #74630 [Opn]: Syntax error in example

From: Date: Mon, 22 May 2017 12:06:16 +0000
Subject: Doc #74630 [Opn]: Syntax error in example
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-14711@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 User updated by: ionut dot mihaescu at gmail dot com Reported by: ionut dot mihaescu at gmail dot com Summary: Syntax error in example Status: Open Type: Documentation Problem Package: Documentation problem Operating System: Ubuntu 16.04 x64 PHP Version: 7.0.19 Block user comment: N Private report: N New Comment: I miss typed : ... should and in a bracket "]" not in ")". Should be: ... should end in a bracket "]" not in ")". Previous Comments: ------------------------------------------------------------------------ [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 (#14711) next »