|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12345 Error in yp_match return value
Submitted: 2001-07-24 13:20 UTC Modified: 2007-04-04 19:05 UTC
Avg. Score:2.6 ± 1.3
Reproduced:2 of 5 (40.0%)
Same Version:4 (200.0%)
Same OS:1 (50.0%)
From: jmaziarz at mitre dot org Assigned:
Status: Closed Package: Unknown/Other Function
PHP Version: 4.0.6 OS: Solaris 2.7
Private report: No CVE-ID: None
 [2001-07-24 13:20 UTC] jmaziarz at mitre dot org
After upgrading to PHP v4.0.6 from v4.0.5 this problem seems to have started. When using yp_match() the documentation states:

"yp_match() returns the value associated with the passed key out of the specified map or FALSE"

However, FALSE is *NOT* returned if the key does not exist. Instead, I get the warning:

"Warning: no such key in map in [my script] on line [my line]"

As a quick fix, I surpress the error with @yp_match(). Has the function changed or is the documentation wrong?

My config is as follows:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-12-17 10:48 UTC]
Changes were made between version 4.0.5 and 4.0.6 to display this warning.

However, the function still returns FALSE, and should work as before if warning is suppressed via @yp_match() or error_reporting()

 [2002-01-07 02:22 UTC]
No feedback. Closed.
 [2002-10-16 09:14 UTC] tshort at cisco dot com
yp_match() returns the value correctly, but generates a warning on a "sucessful failure", meaning that a warning is generated when the match fails, and the return value is false (this is as of 4.2.3).

When there is no match, a warning should not be generated. This is the purpose of the call, to find or not find something.
 [2017-03-14 15:05 UTC] zaondjja at eelmail dot com
Is this still an issue?
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Apr 01 02:01:22 2020 UTC