php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #45088 Example #1 for PDO->sqliteCreateAggregate() doesn't work
Submitted: 2008-05-25 18:12 UTC Modified: 2008-11-05 16:45 UTC
From: rogutes at gmail dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2008-05-25 18:12 UTC] rogutes at gmail dot com
Description:
------------
It seems that PDO->sqliteCreateAggregate() (or at least Example #1) isn't working as documented .
Documentation and Example #1 talks against using a copy of $context, but this function from the example doesn't work, unless you return $context:
function max_len_step(&$context, $rownumber, $string) 
{
    if (strlen($string) > $context) {
        $context = strlen($string);
    }
}


Reproduce code:
---------------
The code block from Example #1


Expected result:
----------------
array(1) {
  [0]=>
  array(2) {
    ["max_len(a)"]=>
    string(1) "5"
    [0]=>
    string(1) "5"
  }
}


Actual result:
--------------
array(1) {
  [0]=>
  array(2) {
    ["max_len(a)"]=>
    NULL
    [0]=>
    NULL
  }
}


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-05 16:45 UTC] vrana@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.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 15:00:02 2026 UTC