Doc #60566 [Bgs]: Highlight that 3rd argument $matches only became optional in 5.4.0

From: Date: Thu, 22 Dec 2011 11:09:18 +0000
Subject: Doc #60566 [Bgs]: Highlight that 3rd argument $matches only became optional in 5.4.0
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-7705@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=60566&edit=1

 ID:                 60566
 User updated by:    martinb at online dot ie
 Reported by:        martinb at online dot ie
 Summary:            Highlight that 3rd argument $matches only became
                     optional in 5.4.0
 Status:             Bogus
 Type:               Documentation Problem
 Package:            Documentation problem
 Operating System:   Ubuntu 10.04
 PHP Version:        Irrelevant
 Block user comment: N
 Private report:     N

 New Comment:

The backwards compatibility of the *documentation* is affected because it's misleading. This
isn't like other cases where a parameter is made optional and defaults to some value, this is a
fix to a usage case of preg_match_all (counting instances) where the matches parameter should never
have been required and thus it's natural to assume it's always been the case. 

Re "Bogus": words matter. If you don't mean bogus then please relabel the report
"Closed" or "Rejected" or something accurate. Failing that please remove it and
my email address from your system.


Previous Comments:
------------------------------------------------------------------------
[2011-12-21 21:38:43] frozenfire@php.net

Please don't take the marking of your bug as "bogus" to be an insult. What often 
occurs is that we go through a slew of bugs quickly and weed out the ones we 
won't or cannot fix. Bogus usually means that a submitted bug asks for a solution 
which would be contrary to our documentation style.

In this case, we usually only represent changes to functions in the changelog. 
It's rare that we will make additional mentions of changes, and those are only in 
cases where backwards compatibility is severely effected.

------------------------------------------------------------------------
[2011-12-21 19:16:51] martinb at online dot ie

Did I say they shouldn't? Other changes to functions are highlighted at the top of the
document: fgetcsv is a particularly good example. 

Also, is it standard to mark rejected bug reports as "Bogus"? Whether this gotcha (got me
anyhow) merits highlighting may be moot but the report is not bogus, and it's pretty
objectionable to be so labelled.

------------------------------------------------------------------------
[2011-12-21 14:29:46] bjori@php.net

No, all changes to functions are described as changelog entries

See http://www.php.net/manual/en/about.phpversions.php
for more details on which 
versions we document.

------------------------------------------------------------------------
[2011-12-19 20:17:05] martinb at online dot ie

Description:
------------
---
From manual page: http://www.php.net/function.preg-match-all#refsect1-function.preg-match-all-description
---

The fact that the 3rd argument matches was not optional before 5.4.0 needs to be highlighted at the
top the documentation, not buried in the change log.



Test script:
---------------
<?php
// PHP 5.3.2
if (preg_match_all('/a/', 'aaa') === false) error_log("returns
false");
?>


Expected result:
----------------
Nothing

Actual result:
--------------
PHP Warning:  preg_match_all() expects at least 3 parameters, 2 given in /var/www/noname/test.php on
line 3
PHP Stack trace:
PHP   1. {main}() /var/www/noname/test.php:0
PHP   2. preg_match_all() /var/www/noname/test.php:3
returns false



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=60566&edit=1


Thread (8 messages)

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