Bug #12345 [Com]: Error in yp_match return value
| From: | zaondjja at eelmail dot com | Date: | Tue, 14 Mar 2017 15:05:53 +0000 |
| Subject: | Bug #12345 [Com]: Error in yp_match return value | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-207829@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=12345&edit=1
ID: 12345
Comment by: zaondjja at eelmail dot com
Reported by: jmaziarz at mitre dot org
Summary: Error in yp_match return value
Status: Closed
Type: Bug
Package: Unknown/Other Function
Operating System: Solaris 2.7
PHP Version: 4.0.6
Block user comment: N
Private report: N
New Comment:
Is this still an issue?
Previous Comments:
------------------------------------------------------------------------
[2002-10-16 09:14:31] 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.
------------------------------------------------------------------------
[2002-01-07 02:22:04] lobbin@php.net
No feedback. Closed.
------------------------------------------------------------------------
[2001-12-17 10:48:35] lobbin@php.net
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()
R.
------------------------------------------------------------------------
[2001-07-24 13:20:27] 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:
./configure
--with-apxs=/afs/rcf/apps/apache/sun4x_57/1.3.20/bin/apxs
--with-config-file-path=/afs/rcf/apps/apache/sun4x_57/1.3.20/conf
--prefix=/afs/rcf/apps/apache/sun4x_57/1.3.20
--with-pgsql=/afs/rcf/apps/pgsql
--with-imap=/afs/rcf/admin/local
--with-ldap=/afs/rcf/admin/local
--with-xml
--without-mysql
--enable-track-vars
--enable-magic-quotes
--enable-yp
--enable-debug
--disable-short-tags
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=12345&edit=1