php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #74630 Syntax error in example
Submitted: 2017-05-22 12:04 UTC Modified: 2017-05-22 16:35 UTC
From: ionut dot mihaescu at gmail dot com Assigned: cmb (profile)
Status: Closed Package: mongodb (PECL)
PHP Version: 7.0.19 OS: Ubuntu 16.04 x64
Private report: No CVE-ID: None
 [2017-05-22 12:04 UTC] 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
    ],
];


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-05-22 12:06 UTC] 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 16:27 UTC] cmb@php.net
-Status: Open +Status: Verified -Package: Documentation problem +Package: mongodb -Assigned To: +Assigned To: cmb
 [2017-05-22 16:35 UTC] cmb@php.net
-Status: Verified +Status: Closed
 [2017-05-22 16:35 UTC] 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.

Fixed with <http://svn.php.net/viewvc?view=revision&revision=342493>.
 [2017-06-29 15:53 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=342493
Log: Fix #74630: Syntax error in example
 [2017-06-29 15:58 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=342493
Log: Fix #74630: Syntax error in example
 [2020-02-07 06:06 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=cd016816d6b6bf8a1297bdb8103ae5e2bdc99d28
Log: Fix #74630: Syntax error in example
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 18:01:31 2024 UTC