From 81b2533a68ffc4fdc7ba0a4b8e516fe1a495451f Mon Sep 17 00:00:00 2001 From: Tyson Andre Date: Wed, 7 Jun 2017 23:50:20 -0700 Subject: [PATCH 01/12] Fixes bug #74708 reflection signatures for random_bytes+random_int They have 1 and 2 required parameters, respectively See https://secure.php.net/manual/en/function.random-int.php --- ext/standard/basic_functions.c | 4 ++-- ext/standard/tests/random/reflection.phpt | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 ext/standard/tests/random/reflection.phpt diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 99ca20f550e62..7671cabbb5cc0 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -1912,11 +1912,11 @@ ZEND_BEGIN_ARG_INFO(arginfo_mt_getrandmax, 0) ZEND_END_ARG_INFO() /* }}} */ /* {{{ random.c */ -ZEND_BEGIN_ARG_INFO_EX(arginfo_random_bytes, 0, 0, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_random_bytes, 0, 0, 1) ZEND_ARG_INFO(0, length) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_random_int, 0, 0, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_random_int, 0, 0, 2) ZEND_ARG_INFO(0, min) ZEND_ARG_INFO(0, max) ZEND_END_ARG_INFO() diff --git a/ext/standard/tests/random/reflection.phpt b/ext/standard/tests/random/reflection.phpt new file mode 100644 index 0000000000000..2df6a33be7318 --- /dev/null +++ b/ext/standard/tests/random/reflection.phpt @@ -0,0 +1,19 @@ +--TEST-- +Bug #74708 Wrong reflection on random_bytes and random_int +--FILE-- +getNumberOfParameters()); +var_dump($rf->getNumberOfRequiredParameters()); + +$rf = new ReflectionFunction('random_int'); +var_dump($rf->getNumberOfParameters()); +var_dump($rf->getNumberOfRequiredParameters()); +?> +===DONE=== +--EXPECT-- +int(1) +int(1) +int(2) +int(2) +===DONE=== From aea8c6ddc18b9e44dd4baec2c6827bc08f40a0bd Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 13 Jun 2017 08:14:34 +0200 Subject: [PATCH 02/12] NEWS --- NEWS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS b/NEWS index a315d0369e022..daabe0175b0ee 100644 --- a/NEWS +++ b/NEWS @@ -31,6 +31,10 @@ PHP NEWS . Fixed bug #74478 (null coalescing operator failing with SplFixedArray). (jhdxr) +- Standard: + . Fixed bug #74708 (Invalid Reflection signatures for random_bytes and + random_int). (Tyson Andre, Remi) + - FTP: . Fixed bug #74598 (ftp:// wrapper ignores context arg). (Sara) From 593d37376b272f990a3007957a037b57e570216e Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 13 Jun 2017 08:15:19 +0200 Subject: [PATCH 03/12] NEWS --- NEWS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS b/NEWS index f0e1afccd2d33..7c37c3f64b457 100644 --- a/NEWS +++ b/NEWS @@ -288,6 +288,8 @@ PHP NEWS anonymous classes). (Adam Saponara) . Fixed bug #74105 (PHP on Linux should use /dev/urandom when getrandom is not available). (Benjamin Robin) + . Fixed bug #74708 (Invalid Reflection signatures for random_bytes and + random_int). (Tyson Andre, Remi) - Streams: . Fixed bug #73496 (Invalid memory access in zend_inline_hash_func). From 5f07a895cc340fea081938731f0c9c3b967f062f Mon Sep 17 00:00:00 2001 From: Tyson Andre Date: Wed, 7 Jun 2017 21:32:57 -0700 Subject: [PATCH 04/12] Fixes bug #74705 Wrong ReflectionInfo for Collator::getSortKey() https://secure.php.net/manual/en/collator.getsortkey.php --- ext/intl/collator/collator_class.c | 2 +- ext/intl/tests/bug74705.phpt | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 ext/intl/tests/bug74705.phpt diff --git a/ext/intl/collator/collator_class.c b/ext/intl/collator/collator_class.c index 0821cb19d8f6b..26917fd5d7eb1 100644 --- a/ext/intl/collator/collator_class.c +++ b/ext/intl/collator/collator_class.c @@ -119,7 +119,7 @@ zend_function_entry Collator_class_functions[] = { PHP_NAMED_FE( getLocale, ZEND_FN( collator_get_locale ), collator_1_arg ) PHP_NAMED_FE( getErrorCode, ZEND_FN( collator_get_error_code ), collator_0_args ) PHP_NAMED_FE( getErrorMessage, ZEND_FN( collator_get_error_message ), collator_0_args ) - PHP_NAMED_FE( getSortKey, ZEND_FN( collator_get_sort_key ), collator_2_args ) + PHP_NAMED_FE( getSortKey, ZEND_FN( collator_get_sort_key ), collator_1_arg ) PHP_FE_END }; /* }}} */ diff --git a/ext/intl/tests/bug74705.phpt b/ext/intl/tests/bug74705.phpt new file mode 100644 index 0000000000000..f26dfe5825e86 --- /dev/null +++ b/ext/intl/tests/bug74705.phpt @@ -0,0 +1,22 @@ +--TEST-- +Bug #74705 Wrong reflection on Collator::getSortKey +--SKIPIF-- + += 0) die('skip for ICU < 51.2'); ?> +--FILE-- +getNumberOfParameters()); +var_dump($rm->getNumberOfRequiredParameters()); + +$rf = new ReflectionFunction('collator_get_sort_key'); +var_dump($rf->getNumberOfParameters()); +var_dump($rf->getNumberOfRequiredParameters()); +?> +===DONE=== +--EXPECT-- +int(1) +int(1) +int(2) +int(2) +===DONE=== From 78970d5338e443eb19b6e589a4f6c449ca0a3d02 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 13 Jun 2017 08:48:17 +0200 Subject: [PATCH 05/12] Fix bug #74705 for collator_get_sort_key --- ext/intl/php_intl.c | 2 +- ext/intl/tests/bug74705.phpt | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/ext/intl/php_intl.c b/ext/intl/php_intl.c index 787cb48fcc556..9584be76cd98b 100644 --- a/ext/intl/php_intl.c +++ b/ext/intl/php_intl.c @@ -655,7 +655,7 @@ zend_function_entry intl_functions[] = { PHP_FE( collator_get_locale, collator_1_arg ) PHP_FE( collator_get_error_code, collator_0_args ) PHP_FE( collator_get_error_message, collator_0_args ) - PHP_FE( collator_get_sort_key, collator_2_args ) + PHP_FE( collator_get_sort_key, collator_1_arg ) /* formatter functions */ PHP_FE( numfmt_create, arginfo_numfmt_create ) diff --git a/ext/intl/tests/bug74705.phpt b/ext/intl/tests/bug74705.phpt index f26dfe5825e86..63a85845a0a72 100644 --- a/ext/intl/tests/bug74705.phpt +++ b/ext/intl/tests/bug74705.phpt @@ -2,7 +2,6 @@ Bug #74705 Wrong reflection on Collator::getSortKey --SKIPIF-- -= 0) die('skip for ICU < 51.2'); ?> --FILE-- Date: Tue, 13 Jun 2017 08:50:02 +0200 Subject: [PATCH 06/12] NEWS --- NEWS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS b/NEWS index daabe0175b0ee..c39d6e2b28876 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,8 @@ PHP NEWS - Intl: . Fixed bug #73473 (Stack Buffer Overflow in msgfmt_parse_message). (libnex) + . Fixed bug #74705 (Wrong reflection on Collator::getSortKey and + collator_get_sort_key). (Tyson Andre, Remi) - Mbstring: . Add oniguruma upstream fix (CVE-2017-9224, CVE-2017-9226, CVE-2017-9227, From 6408c66d3c2b73f3e08e17365d91105e09ae2b9d Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 13 Jun 2017 08:50:24 +0200 Subject: [PATCH 07/12] NEWS --- NEWS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS b/NEWS index 7c37c3f64b457..d0db08b5f6513 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,8 @@ PHP NEWS - Intl: . Fixed bug #73473 (Stack Buffer Overflow in msgfmt_parse_message). (libnex) + . Fixed bug #74705 (Wrong reflection on Collator::getSortKey and + collator_get_sort_key). (Tyson Andre, Remi) - Mbstring: . Add oniguruma upstream fix (CVE-2017-9224, CVE-2017-9226, CVE-2017-9227, From 1385784f54de9b620c82fd881f563b99ccff0956 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 13 Jun 2017 12:20:14 +0300 Subject: [PATCH 08/12] Fixed performance degradaton introduced in f6ac96b --- ext/json/json_encoder.c | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/ext/json/json_encoder.c b/ext/json/json_encoder.c index 6b55a83ca1f9d..f0d02bfbd0b56 100644 --- a/ext/json/json_encoder.c +++ b/ext/json/json_encoder.c @@ -252,7 +252,7 @@ static int php_json_escape_string( { int status; unsigned int us; - size_t prev_pos, pos, checkpoint; + size_t pos, checkpoint; if (len == 0) { smart_str_appendl(buf, "\"\"", 2); @@ -283,27 +283,31 @@ static int php_json_escape_string( smart_str_appendc(buf, '"'); do { - prev_pos = pos; - us = php_next_utf8_char((unsigned char *)s, len, &pos, &status); - /* check whether UTF8 character is correct */ - if (status != SUCCESS) { - if (buf->s) { - ZSTR_LEN(buf->s) = checkpoint; - } - encoder->error_code = PHP_JSON_ERROR_UTF8; - if (options & PHP_JSON_PARTIAL_OUTPUT_ON_ERROR) { - smart_str_appendl(buf, "null", 4); + us = (unsigned char)s[pos]; + if (us >= 0x80) { + size_t prev_pos = pos; + + us = php_next_utf8_char((unsigned char *)s, len, &pos, &status); + + /* check whether UTF8 character is correct */ + if (status != SUCCESS) { + if (buf->s) { + ZSTR_LEN(buf->s) = checkpoint; + } + encoder->error_code = PHP_JSON_ERROR_UTF8; + if (options & PHP_JSON_PARTIAL_OUTPUT_ON_ERROR) { + smart_str_appendl(buf, "null", 4); + } + return FAILURE; } - return FAILURE; - } - if (us >= 0x80 && (!(options & PHP_JSON_UNESCAPED_UNICODE) || (unsigned char)s[prev_pos] == 0xE2)) { + /* Escape U+2028/U+2029 line terminators, UNLESS both JSON_UNESCAPED_UNICODE and JSON_UNESCAPED_LINE_TERMINATORS were provided */ if ((options & PHP_JSON_UNESCAPED_UNICODE) - && ((options & PHP_JSON_UNESCAPED_LINE_TERMINATORS) + && ((options & PHP_JSON_UNESCAPED_LINE_TERMINATORS) || us < 0x2028 || us > 0x2029)) { - smart_str_appendl(buf, &s[prev_pos], 3); + smart_str_appendl(buf, s + prev_pos, pos - prev_pos); continue; } /* From http://en.wikipedia.org/wiki/UTF16 */ @@ -325,6 +329,8 @@ static int php_json_escape_string( smart_str_appendc(buf, digits[(us & 0xf0) >> 4]); smart_str_appendc(buf, digits[(us & 0xf)]); } else { + pos++; + switch (us) { case '"': if (options & PHP_JSON_HEX_QUOT) { @@ -400,7 +406,7 @@ static int php_json_escape_string( default: if (us >= ' ') { - smart_str_appendl(buf, s + prev_pos, pos - prev_pos); + smart_str_appendc(buf, (unsigned char) us); } else { smart_str_appendl(buf, "\\u00", sizeof("\\u00")-1); smart_str_appendc(buf, digits[(us & 0xf0) >> 4]); From 8fe47a47cf30eb3bf50a5cdb4e07f6fa135d21c7 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 13 Jun 2017 13:48:58 +0300 Subject: [PATCH 09/12] Avoid run-time checks performed at compile-time. --- Zend/zend_vm_def.h | 3 ++- Zend/zend_vm_execute.h | 27 ++++++++++++++++++--------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index dc00f3ce121b4..7b390939bce7b 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -6520,7 +6520,8 @@ ZEND_VM_C_LABEL(isset_str_offset): ZVAL_DEREF(offset); } if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */ - || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */ + || (OP2_TYPE != IS_CONST + && Z_TYPE_P(offset) == IS_STRING /* or numeric string */ && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) { lval = zval_get_long(offset); ZEND_VM_C_GOTO(isset_str_offset); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index b34082a2f74e1..35bf0d3eae38b 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -6180,7 +6180,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CON ZVAL_DEREF(offset); } if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */ - || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */ + || (IS_CONST != IS_CONST + && Z_TYPE_P(offset) == IS_STRING /* or numeric string */ && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) { lval = zval_get_long(offset); goto isset_str_offset; @@ -10055,7 +10056,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CON ZVAL_DEREF(offset); } if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */ - || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */ + || (IS_CV != IS_CONST + && Z_TYPE_P(offset) == IS_STRING /* or numeric string */ && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) { lval = zval_get_long(offset); goto isset_str_offset; @@ -11989,7 +11991,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CON ZVAL_DEREF(offset); } if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */ - || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */ + || ((IS_TMP_VAR|IS_VAR) != IS_CONST + && Z_TYPE_P(offset) == IS_STRING /* or numeric string */ && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) { lval = zval_get_long(offset); goto isset_str_offset; @@ -38401,7 +38404,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_ ZVAL_DEREF(offset); } if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */ - || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */ + || (IS_CONST != IS_CONST + && Z_TYPE_P(offset) == IS_STRING /* or numeric string */ && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) { lval = zval_get_long(offset); goto isset_str_offset; @@ -44735,7 +44739,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_ ZVAL_DEREF(offset); } if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */ - || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */ + || (IS_CV != IS_CONST + && Z_TYPE_P(offset) == IS_STRING /* or numeric string */ && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) { lval = zval_get_long(offset); goto isset_str_offset; @@ -48285,7 +48290,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_ ZVAL_DEREF(offset); } if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */ - || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */ + || ((IS_TMP_VAR|IS_VAR) != IS_CONST + && Z_TYPE_P(offset) == IS_STRING /* or numeric string */ && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) { lval = zval_get_long(offset); goto isset_str_offset; @@ -50327,7 +50333,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMP ZVAL_DEREF(offset); } if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */ - || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */ + || (IS_CONST != IS_CONST + && Z_TYPE_P(offset) == IS_STRING /* or numeric string */ && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) { lval = zval_get_long(offset); goto isset_str_offset; @@ -52522,7 +52529,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMP ZVAL_DEREF(offset); } if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */ - || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */ + || (IS_CV != IS_CONST + && Z_TYPE_P(offset) == IS_STRING /* or numeric string */ && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) { lval = zval_get_long(offset); goto isset_str_offset; @@ -53817,7 +53825,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMP ZVAL_DEREF(offset); } if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */ - || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */ + || ((IS_TMP_VAR|IS_VAR) != IS_CONST + && Z_TYPE_P(offset) == IS_STRING /* or numeric string */ && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) { lval = zval_get_long(offset); goto isset_str_offset; From 362d2e42a02fe018a7d1261a53ff59b73fed91f6 Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Tue, 13 Jun 2017 15:45:57 +0200 Subject: [PATCH 10/12] Use "Mac" instead of "OSX" to identify macOS in PHP_OS_FAMILY --- main/php.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/php.h b/main/php.h index 7b1a9256bafe2..e14d6258d2d3d 100644 --- a/main/php.h +++ b/main/php.h @@ -47,7 +47,7 @@ #elif defined(BSD) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) # define PHP_OS_FAMILY "BSD" #elif defined(__APPLE__) || defined(__MACH__) -# define PHP_OS_FAMILY "OSX" +# define PHP_OS_FAMILY "Mac" #elif defined(__sun__) # define PHP_OS_FAMILY "Solaris" #elif defined(__linux__) From 648be8600ff89e1b0e4a4ad25cebad42b53bed6d Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 13 Jun 2017 17:15:47 +0300 Subject: [PATCH 11/12] Fixed bug #74679 (Incorrect conversion array with WSDL_CACHE_MEMORY) --- NEWS | 4 ++++ ext/soap/php_sdl.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index c39d6e2b28876..1e6ffa13c24e5 100644 --- a/NEWS +++ b/NEWS @@ -43,6 +43,10 @@ PHP NEWS - PHAR: . Fixed bug #74386 (Phar::__construct reflection incorrect). (villfa) +- SOAP + . Fixed bug #74679 (Incorrect conversion array with WSDL_CACHE_MEMORY). + (Dmitry) + - Streams: . Fixed bug #74556 (stream_socket_get_name() returns '\0'). (Sara) diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c index 49fd363511fd3..c53fa8a758425 100644 --- a/ext/soap/php_sdl.c +++ b/ext/soap/php_sdl.c @@ -2623,7 +2623,7 @@ static sdlAttributePtr make_persistent_sdl_attribute(sdlAttributePtr attr, HashT pattr->extraAttributes = malloc(sizeof(HashTable)); zend_hash_init(pattr->extraAttributes, zend_hash_num_elements(attr->extraAttributes), NULL, delete_extra_attribute_persistent, 1); - ZEND_HASH_FOREACH_STR_KEY_PTR(pattr->extraAttributes, key, tmp) { + ZEND_HASH_FOREACH_STR_KEY_PTR(attr->extraAttributes, key, tmp) { if (key) { pextra = malloc(sizeof(sdlExtraAttribute)); memset(pextra, 0, sizeof(sdlExtraAttribute)); From a251d9b2c11c2ab53b0214d728c40d70cd06567c Mon Sep 17 00:00:00 2001 From: Kalle Sommer Nielsen Date: Wed, 14 Jun 2017 03:29:06 +0200 Subject: [PATCH 12/12] Change PHP_OS_FAMILY to "Darwin" instead of "Mac" for Darwin based systems (as suggested by Davey) --- main/php.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/php.h b/main/php.h index e14d6258d2d3d..116485a811bea 100644 --- a/main/php.h +++ b/main/php.h @@ -47,7 +47,7 @@ #elif defined(BSD) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) # define PHP_OS_FAMILY "BSD" #elif defined(__APPLE__) || defined(__MACH__) -# define PHP_OS_FAMILY "Mac" +# define PHP_OS_FAMILY "Darwin" #elif defined(__sun__) # define PHP_OS_FAMILY "Solaris" #elif defined(__linux__)