Skip to content

Consolidate the usage of "either" and "one of" in error messages #6173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ext/ftp/php_ftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,7 @@ PHP_FUNCTION(ftp_set_option)
RETURN_TRUE;
break;
default:
zend_argument_value_error(2, "must be either FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS");
zend_argument_value_error(2, "must be one of FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS");
RETURN_THROWS();
break;
}
Expand Down Expand Up @@ -1317,7 +1317,7 @@ PHP_FUNCTION(ftp_get_option)
RETURN_BOOL(ftp->usepasvaddress);
break;
default:
zend_argument_value_error(2, "must be either FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS");
zend_argument_value_error(2, "must be one of FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS");
RETURN_THROWS();
}
}
Expand Down
2 changes: 1 addition & 1 deletion ext/ftp/tests/ftp_get_option.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ try {
int(%d)
bool(true)
bool(true)
ftp_get_option(): Argument #2 ($option) must be either FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS
ftp_get_option(): Argument #2 ($option) must be one of FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS
2 changes: 1 addition & 1 deletion ext/ftp/tests/ftp_set_option_errors.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ ftp_set_option(): Argument #3 ($value) must be greater than 0 for the FTP_TIMEOU
ftp_set_option(): Argument #3 ($value) must be of type int for the FTP_TIMEOUT_SEC option, string given
ftp_set_option(): Argument #3 ($value) must be of type bool for the FTP_USEPASVADDRESS option, array given
ftp_set_option(): Argument #3 ($value) must be of type bool for the FTP_AUTOSEEK option, string given
ftp_set_option(): Argument #2 ($option) must be either FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS
ftp_set_option(): Argument #2 ($option) must be one of FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS
2 changes: 1 addition & 1 deletion ext/gd/gd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3521,7 +3521,7 @@ PHP_FUNCTION(imageflip)
break;

default:
zend_argument_value_error(2, "must be either IMG_FLIP_VERTICAL, IMG_FLIP_HORIZONTAL, or IMG_FLIP_BOTH");
zend_argument_value_error(2, "must be one of IMG_FLIP_VERTICAL, IMG_FLIP_HORIZONTAL, or IMG_FLIP_BOTH");
RETURN_THROWS();
}

Expand Down
2 changes: 1 addition & 1 deletion ext/intl/grapheme/grapheme_string.c
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ PHP_FUNCTION(grapheme_extract)
}

if ( extract_type < GRAPHEME_EXTRACT_TYPE_MIN || extract_type > GRAPHEME_EXTRACT_TYPE_MAX ) {
zend_argument_value_error(3, "must be either GRAPHEME_EXTR_COUNT, GRAPHEME_EXTR_MAXBYTES, or GRAPHEME_EXTR_MAXCHARS");
zend_argument_value_error(3, "must be one of GRAPHEME_EXTR_COUNT, GRAPHEME_EXTR_MAXBYTES, or GRAPHEME_EXTR_MAXCHARS");
RETURN_THROWS();
}

Expand Down
2 changes: 1 addition & 1 deletion ext/intl/tests/bug62083.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ try {
}
?>
--EXPECT--
grapheme_extract(): Argument #3 ($extract_type) must be either GRAPHEME_EXTR_COUNT, GRAPHEME_EXTR_MAXBYTES, or GRAPHEME_EXTR_MAXCHARS
grapheme_extract(): Argument #3 ($extract_type) must be one of GRAPHEME_EXTR_COUNT, GRAPHEME_EXTR_MAXBYTES, or GRAPHEME_EXTR_MAXCHARS
2 changes: 1 addition & 1 deletion ext/ldap/ldap.c
Original file line number Diff line number Diff line change
Expand Up @@ -2655,7 +2655,7 @@ PHP_FUNCTION(ldap_modify_batch)
modtype != LDAP_MODIFY_BATCH_REPLACE &&
modtype != LDAP_MODIFY_BATCH_REMOVE_ALL
) {
zend_value_error("%s(): Option \"" LDAP_MODIFY_BATCH_MODTYPE "\" must be one of LDAP_MODIFY_BATCH_ADD, LDAP_MODIFY_BATCH_REMOVE, LDAP_MODIFY_BATCH_REPLACE, or LDAP_MODIFY_BATCH_REMOVE_ALL", get_active_function_name());
zend_value_error("%s(): Option \"" LDAP_MODIFY_BATCH_MODTYPE "\" must be one of the LDAP_MODIFY_BATCH_* constants", get_active_function_name());
RETURN_THROWS();
}

Expand Down
5 changes: 2 additions & 3 deletions ext/mbstring/mbstring.c
Original file line number Diff line number Diff line change
Expand Up @@ -1307,7 +1307,7 @@ PHP_FUNCTION(mb_http_input)
return;
default:
zend_argument_value_error(1,
"must be one of \"G\", \"P\", \"C\", \"S\", \"I\" or \"L\"");
"must be one of \"G\", \"P\", \"C\", \"S\", \"I\", or \"L\"");
RETURN_THROWS();
}
}
Expand Down Expand Up @@ -2596,8 +2596,7 @@ PHP_FUNCTION(mb_convert_case)
}

if (case_mode < 0 || case_mode > PHP_UNICODE_CASE_MODE_MAX) {
zend_argument_value_error(2, "must be one of MB_CASE_UPPER, MB_CASE_LOWER, MB_CASE_TITLE, MB_CASE_FOLD,"
" MB_CASE_UPPER_SIMPLE, MB_CASE_LOWER_SIMPLE, MB_CASE_TITLE_SIMPLE, or MB_CASE_FOLD_SIMPLE");
zend_argument_value_error(2, "must be one of the MB_CASE_* constants");
RETURN_THROWS();
}

Expand Down
2 changes: 1 addition & 1 deletion ext/mbstring/tests/mb_convert_case_various_mode.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ string(13) "FOO BAR SPAß"
string(13) "foo bar spaß"
string(13) "Foo Bar Spaß"
string(13) "foo bar spaß"
mb_convert_case(): Argument #2 ($mode) must be one of MB_CASE_UPPER, MB_CASE_LOWER, MB_CASE_TITLE, MB_CASE_FOLD, MB_CASE_UPPER_SIMPLE, MB_CASE_LOWER_SIMPLE, MB_CASE_TITLE_SIMPLE, or MB_CASE_FOLD_SIMPLE
mb_convert_case(): Argument #2 ($mode) must be one of the MB_CASE_* constants
2 changes: 1 addition & 1 deletion ext/mbstring/tests/mb_http_input.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ array(1) {
string(10) "ISO-8859-1"
}
string(10) "ISO-8859-1"
mb_http_input(): Argument #1 ($type) must be one of "G", "P", "C", "S", "I" or "L"
mb_http_input(): Argument #1 ($type) must be one of "G", "P", "C", "S", "I", or "L"
3 changes: 1 addition & 2 deletions ext/mysqli/mysqli_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -2270,8 +2270,7 @@ PHP_FUNCTION(mysqli_stmt_attr_set)
case CURSOR_TYPE_SCROLLABLE:
break;
default:
zend_argument_value_error(ERROR_ARG_POS(3), "must be one of MYSQLI_CURSOR_TYPE_NO_CURSOR, "
"MYSQLI_CURSOR_TYPE_READ_ONLY, MYSQLI_CURSOR_TYPE_FOR_UPDATE, or MYSQLI_CURSOR_TYPE_SCROLLABLE "
zend_argument_value_error(ERROR_ARG_POS(3), "must be one of the MYSQLI_CURSOR_TYPE_* constants "
"for attribute MYSQLI_STMT_ATTR_CURSOR_TYPE");
RETURN_THROWS();
}
Expand Down
2 changes: 1 addition & 1 deletion ext/mysqli/mysqli_nonapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ PHP_FUNCTION(mysqli_query)
if ((resultmode & ~MYSQLI_ASYNC) != MYSQLI_USE_RESULT &&
MYSQLI_STORE_RESULT != (resultmode & ~(MYSQLI_ASYNC | MYSQLI_STORE_RESULT_COPY_DATA))
) {
zend_argument_value_error(ERROR_ARG_POS(3), "must be either MYSQLI_USE_RESULT, or MYSQLI_STORE_RESULT"
zend_argument_value_error(ERROR_ARG_POS(3), "must be either MYSQLI_USE_RESULT or MYSQLI_STORE_RESULT"
#ifdef MYSQLI_USE_MYSQLND
" with MYSQLI_ASYNC as an optional bitmask flag"
#endif
Expand Down
2 changes: 1 addition & 1 deletion ext/mysqli/tests/mysqli_query.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,6 @@ array(1) {
string(1) "a"
}
string(1) "a"
mysqli_query(): Argument #3 ($result_mode) must be either MYSQLI_USE_RESULT, or MYSQLI_STORE_RESULT%S
mysqli_query(): Argument #3 ($result_mode) must be either MYSQLI_USE_RESULT or MYSQLI_STORE_RESULT%S
mysqli object is already closed
done!
2 changes: 1 addition & 1 deletion ext/mysqli/tests/mysqli_stmt_attr_set.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,6 @@ Error: mysqli_stmt object is not fully initialized
mysqli_stmt_attr_set(): Argument #2 ($attr) must be one of MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH, MYSQLI_STMT_ATTR_PREFETCH_ROWS, or STMT_ATTR_CURSOR_TYPE
mysqli_stmt::attr_set(): Argument #2 ($mode_in) must be 0 or 1 for attribute MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH
bool(true)
mysqli_stmt::attr_set(): Argument #2 ($mode_in) must be one of MYSQLI_CURSOR_TYPE_NO_CURSOR, MYSQLI_CURSOR_TYPE_READ_ONLY, MYSQLI_CURSOR_TYPE_FOR_UPDATE, or MYSQLI_CURSOR_TYPE_SCROLLABLE for attribute MYSQLI_STMT_ATTR_CURSOR_TYPE
mysqli_stmt::attr_set(): Argument #2 ($mode_in) must be one of the MYSQLI_CURSOR_TYPE_* constants for attribute MYSQLI_STMT_ATTR_CURSOR_TYPE
mysqli_stmt::attr_set(): Argument #2 ($mode_in) must be greater than 0 for attribute MYSQLI_STMT_ATTR_PREFETCH_ROWS
done!
2 changes: 1 addition & 1 deletion ext/pdo_odbc/pdo_odbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ PHP_MINIT_FUNCTION(pdo_odbc)
} else if (*pooling_val == '\0' || strcasecmp(pooling_val, "off") == 0) {
pdo_odbc_pool_on = SQL_CP_OFF;
} else {
php_error_docref(NULL, E_CORE_ERROR, "Error in pdo_odbc.connection_pooling configuration. Value MUST be one of 'strict', 'relaxed' or 'off'");
php_error_docref(NULL, E_CORE_ERROR, "Error in pdo_odbc.connection_pooling configuration. Value must be one of \"strict\", \"relaxed\", or \"off\"");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this become a ValueError?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a config value, and I'm not sure what we do with them.

return FAILURE;
}

Expand Down
2 changes: 1 addition & 1 deletion ext/reflection/php_reflection.c
Original file line number Diff line number Diff line change
Expand Up @@ -2320,7 +2320,7 @@ ZEND_METHOD(ReflectionParameter, __construct)
break;

default:
zend_argument_error(reflection_exception_ptr, 1, "must be either a string, an array(class, method) or a callable object, %s given", zend_zval_type_name(reference));
zend_argument_error(reflection_exception_ptr, 1, "must be one of a string, an array(class, method), or a callable object, %s given", zend_zval_type_name(reference));
RETURN_THROWS();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ Class "A" does not exist
Method C::b() does not exist
Method C::b() does not exist
Ok - ReflectionParameter::__construct() expects exactly 2 arguments, 1 given
Ok - ReflectionParameter::__construct(): Argument #1 ($function) must be either a string, an array(class, method) or a callable object, int given
Ok - ReflectionParameter::__construct(): Argument #1 ($function) must be one of a string, an array(class, method), or a callable object, int given
Done.
6 changes: 3 additions & 3 deletions ext/snmp/snmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ static int netsnmp_session_set_auth_protocol(struct snmp_session *s, char *prot)
s->securityAuthProto = usmHMACSHA1AuthProtocol;
s->securityAuthProtoLen = USM_AUTH_PROTO_SHA_LEN;
} else {
zend_value_error("Authentication protocol must be either MD5 or SHA");
zend_value_error("Authentication protocol must be either \"MD5\" or \"SHA\"");
return (-1);
}
return (0);
Expand All @@ -962,9 +962,9 @@ static int netsnmp_session_set_sec_protocol(struct snmp_session *s, char *prot)
#endif
} else {
#ifdef HAVE_AES
zend_value_error("Security protocol must be one of DES, AES128, or AES");
zend_value_error("Security protocol must be one of \"DES\", \"AES128\", or \"AES\"");
#else
zend_value_error("Security protocol must be DES");
zend_value_error("Security protocol must be \"DES\"");
#endif
return (-1);
}
Expand Down
6 changes: 3 additions & 3 deletions ext/snmp/tests/snmp-object-setSecurity_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ var_dump($session->close());
--EXPECTF--
Security level must be one of "noAuthNoPriv", "authNoPriv", or "authPriv"
Security level must be one of "noAuthNoPriv", "authNoPriv", or "authPriv"
Authentication protocol must be either MD5 or SHA
Authentication protocol must be either "MD5" or "SHA"

Warning: SNMP::setSecurity(): Error generating a key for authentication pass phrase '': Generic error (The supplied password length is too short.) in %s on line %d
bool(false)

Warning: SNMP::setSecurity(): Error generating a key for authentication pass phrase 'te': Generic error (The supplied password length is too short.) in %s on line %d
bool(false)
Security protocol must be one of DES, AES128, or AES
Security protocol must be one of DES, AES128, or AES
Security protocol must be one of "DES", "AES128", or "AES"
Security protocol must be one of "DES", "AES128", or "AES"

Warning: SNMP::setSecurity(): Error generating a key for privacy pass phrase '': Generic error (The supplied password length is too short.) in %s on line %d
bool(false)
Expand Down
4 changes: 2 additions & 2 deletions ext/snmp/tests/snmp3-error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ try {
Checking error handling
Security level must be one of "noAuthNoPriv", "authNoPriv", or "authPriv"
Security level must be one of "noAuthNoPriv", "authNoPriv", or "authPriv"
Authentication protocol must be either MD5 or SHA
Authentication protocol must be either "MD5" or "SHA"

Warning: snmp3_get(): Error generating a key for authentication pass phrase '': Generic error (The supplied password length is too short.) in %s on line %d
bool(false)

Warning: snmp3_get(): Error generating a key for authentication pass phrase 'te': Generic error (The supplied password length is too short.) in %s on line %d
bool(false)
Security protocol must be one of DES, AES128, or AES
Security protocol must be one of "DES", "AES128", or "AES"

Warning: snmp3_get(): Error generating a key for privacy pass phrase '': Generic error (The supplied password length is too short.) in %s on line %d
bool(false)
Expand Down
2 changes: 1 addition & 1 deletion ext/soap/soap.c
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ PHP_METHOD(SoapHeader, __construct)
if ((actor_long == SOAP_ACTOR_NEXT || actor_long == SOAP_ACTOR_NONE || actor_long == SOAP_ACTOR_UNLIMATERECEIVER)) {
add_property_long(this_ptr, "actor", actor_long);
} else {
zend_argument_value_error(5, "must be either SOAP_ACTOR_NEXT, SOAP_ACTOR_NONE or SOAP_ACTOR_UNLIMATERECEIVER");
zend_argument_value_error(5, "must be one of SOAP_ACTOR_NEXT, SOAP_ACTOR_NONE, or SOAP_ACTOR_UNLIMATERECEIVER");
RETURN_THROWS();
}
}
Expand Down
24 changes: 12 additions & 12 deletions ext/sockets/sockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@ PHP_FUNCTION(socket_getsockname)
break;

default:
zend_argument_value_error(1, "must be either AF_UNIX, AF_INET, or AF_INET6");
zend_argument_value_error(1, "must be one of AF_UNIX, AF_INET, or AF_INET6");
RETURN_THROWS();
}
}
Expand Down Expand Up @@ -1212,7 +1212,7 @@ PHP_FUNCTION(socket_getpeername)
break;

default:
zend_argument_value_error(1, "must be either AF_UNIX, AF_INET, or AF_INET6");
zend_argument_value_error(1, "must be one of AF_UNIX, AF_INET, or AF_INET6");
RETURN_THROWS();
}
}
Expand All @@ -1233,12 +1233,12 @@ PHP_FUNCTION(socket_create)
&& domain != AF_INET6
#endif
&& domain != AF_INET) {
zend_argument_value_error(1, "must be either AF_UNIX, AF_INET6, or AF_INET");
zend_argument_value_error(1, "must be one of AF_UNIX, AF_INET6, or AF_INET");
RETURN_THROWS();
}

if (type > 10) {
zend_argument_value_error(2, "must be either SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET,"
zend_argument_value_error(2, "must be one of SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET,"
" SOCK_RAW, or SOCK_RDM");
RETURN_THROWS();
}
Expand Down Expand Up @@ -1337,7 +1337,7 @@ PHP_FUNCTION(socket_connect)
}

default:
zend_argument_value_error(1, "must be either AF_UNIX, AF_INET, or AF_INET6");
zend_argument_value_error(1, "must be one of AF_UNIX, AF_INET, or AF_INET6");
RETURN_THROWS();
}

Expand Down Expand Up @@ -1431,7 +1431,7 @@ PHP_FUNCTION(socket_bind)
}
#endif
default:
zend_argument_value_error(1, "must be either AF_UNIX, AF_INET, or AF_INET6");
zend_argument_value_error(1, "must be one of AF_UNIX, AF_INET, or AF_INET6");
RETURN_THROWS();
}

Expand Down Expand Up @@ -1625,7 +1625,7 @@ PHP_FUNCTION(socket_recvfrom)
break;
#endif
default:
zend_argument_value_error(1, "must be either AF_UNIX, AF_INET, or AF_INET6");
zend_argument_value_error(1, "must be one of AF_UNIX, AF_INET, or AF_INET6");
RETURN_THROWS();
}

Expand Down Expand Up @@ -1705,7 +1705,7 @@ PHP_FUNCTION(socket_sendto)
break;
#endif
default:
zend_argument_value_error(1, "must be either AF_UNIX, AF_INET, or AF_INET6");
zend_argument_value_error(1, "must be one of AF_UNIX, AF_INET, or AF_INET6");
RETURN_THROWS();
}

Expand Down Expand Up @@ -1987,12 +1987,12 @@ PHP_FUNCTION(socket_create_pair)
&& domain != AF_INET6
#endif
&& domain != AF_UNIX) {
zend_argument_value_error(1, "must be either AF_UNIX, AF_INET6 or AF_INET");
zend_argument_value_error(1, "must be one of AF_UNIX, AF_INET6, or AF_INET");
RETURN_THROWS();
}

if (type > 10) {
zend_argument_value_error(2, "must be either SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET,"
zend_argument_value_error(2, "must be one of SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET,"
" SOCK_RAW, or SOCK_RDM");
RETURN_THROWS();
}
Expand Down Expand Up @@ -2402,7 +2402,7 @@ PHP_FUNCTION(socket_addrinfo_bind)
default:
close(php_sock->bsd_socket);
zval_ptr_dtor(return_value);
zend_argument_value_error(1, "must be either AF_UNIX, AF_INET, or AF_INET6");
zend_argument_value_error(1, "must be one of AF_UNIX, AF_INET, or AF_INET6");
RETURN_THROWS();
}

Expand Down Expand Up @@ -2463,7 +2463,7 @@ PHP_FUNCTION(socket_addrinfo_connect)
break;
}
default:
zend_argument_value_error(1, "socket type must be either AF_UNIX, AF_INET, or AF_INET6");
zend_argument_value_error(1, "socket type must be one of AF_UNIX, AF_INET, or AF_INET6");
close(php_sock->bsd_socket);
zval_ptr_dtor(return_value);
RETURN_THROWS();
Expand Down
4 changes: 2 additions & 2 deletions ext/sockets/tests/socket_create_pair-wrongparams-win32.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ try {
?>
--EXPECT--
bool(true)
socket_create_pair(): Argument #1 ($domain) must be either AF_UNIX, AF_INET6 or AF_INET
socket_create_pair(): Argument #2 ($type) must be either SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET, SOCK_RAW, or SOCK_RDM
socket_create_pair(): Argument #1 ($domain) must be one of AF_UNIX, AF_INET6, or AF_INET
socket_create_pair(): Argument #2 ($type) must be one of SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET, SOCK_RAW, or SOCK_RDM
--CREDITS--
Till Klampaeckel, [email protected]
Berlin TestFest 2009
4 changes: 2 additions & 2 deletions ext/sockets/tests/socket_create_pair-wrongparams.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ try {
--EXPECTF--
Warning: socket_create_pair(): Unable to create socket pair [%d]: %s not supported in %s on line %d
bool(false)
socket_create_pair(): Argument #1 ($domain) must be either AF_UNIX, AF_INET6 or AF_INET
socket_create_pair(): Argument #2 ($type) must be either SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET, SOCK_RAW, or SOCK_RDM
socket_create_pair(): Argument #1 ($domain) must be one of AF_UNIX, AF_INET6, or AF_INET
socket_create_pair(): Argument #2 ($type) must be one of SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET, SOCK_RAW, or SOCK_RDM
--CREDITS--
Till Klampaeckel, [email protected]
Berlin TestFest 2009
2 changes: 1 addition & 1 deletion ext/standard/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ PHPAPI void php_flock_common(php_stream *stream, zend_long operation,

act = operation & PHP_LOCK_UN;
if (act < 1 || act > 3) {
zend_argument_value_error(operation_arg_num, "must be either LOCK_SH, LOCK_EX, or LOCK_UN");
zend_argument_value_error(operation_arg_num, "must be one of LOCK_SH, LOCK_EX, or LOCK_UN");
RETURN_THROWS();
}

Expand Down
2 changes: 1 addition & 1 deletion ext/standard/tests/file/flock.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ int(0)
bool(true)
int(0)
bool(true)
flock(): Argument #2 ($operation) must be either LOCK_SH, LOCK_EX, or LOCK_UN
flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN
8 changes: 4 additions & 4 deletions ext/standard/tests/file/flock_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ unlink($file);
--EXPECT--
*** Testing error conditions ***
--- Iteration 0 ---
flock(): Argument #2 ($operation) must be either LOCK_SH, LOCK_EX, or LOCK_UN
flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN
--- Iteration 1 ---
flock(): Argument #2 ($operation) must be either LOCK_SH, LOCK_EX, or LOCK_UN
flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN
--- Iteration 2 ---
flock(): Argument #2 ($operation) must be either LOCK_SH, LOCK_EX, or LOCK_UN
flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN
--- Iteration 3 ---
flock(): Argument #2 ($operation) must be either LOCK_SH, LOCK_EX, or LOCK_UN
flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN
--- Iteration 4 ---
flock(): Argument #2 ($operation) must be of type int, array given
--- Iteration 5 ---
Expand Down
4 changes: 2 additions & 2 deletions ext/zlib/tests/007.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ var_dump(gzencode($string, 9, ZLIB_ENCODING_DEFLATE));
--EXPECTF--
gzencode(): Argument #2 ($level) must be between -1 and 9
gzencode(): Argument #2 ($level) must be between -1 and 9
gzencode(): Argument #3 ($encoding) must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE
gzencode(): Argument #3 ($encoding) must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE
string(%d) "%a"
string(%d) "%a"
gzencode(): Argument #3 ($encoding) must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE
gzencode(): Argument #3 ($encoding) must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE
string(%d) "%a"
string(%d) "%a"
2 changes: 1 addition & 1 deletion ext/zlib/tests/deflate_init_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ try {

?>
--EXPECT--
deflate_init(): Argument #1 ($encoding) must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE
deflate_init(): Argument #1 ($encoding) must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE
deflate_init(): "level" option must be between -1 and 9
deflate_init(): "level" option must be between -1 and 9
deflate_init(): "memory" option must be between 1 and 9
Expand Down
Loading