php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #26135 yp_first() example uses deprecated feature
Submitted: 2003-11-05 05:28 UTC Modified: 2003-11-17 15:33 UTC
From: benoit dot sibaud at rd dot francetelecom dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2003-11-05 05:28 UTC] benoit dot sibaud at rd dot francetelecom dot com
Description:
------------
Example from http://www.php.net/manual/en/function.yp-first.php

8<----------------------
<?php
$entry = yp_first($domain, "passwd.byname");
$key = $entry ["key"];
$value = $entry ["value"];
echo "First entry in this map has key " . $key . " and value " . $value;
?>
8<----------------------

"key" and "value" entries are deprecated. (cf bug #8041 and ext/yp/yp.c
8<----------------------
        /* Deprecated */        add_assoc_stringl(return_value,"key",outkey,outkeylen,1);       add_assoc_stringl(return_value,"value",outval,outvallen,1);
8<----------------------).

An example with $key = key($entry); would be better (like for yp_next).


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-11-17 15:33 UTC] didou@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Nov 19 16:00:01 2025 UTC