Skip to content
Merged
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
25 changes: 2 additions & 23 deletions build/Makefile.gcov
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,6 @@ LCOV_EXCLUDES = \
'$(top_srcdir)/parse_date.re' \
'$(top_srcdir)/parse_iso_intervals.re'

GCOVR_EXCLUDES = \
'ext/bcmath/libbcmath/.*' \
'ext/date/lib/.*' \
'ext/fileinfo/libmagic/.*' \
'ext/gd/libgd/.*' \
'ext/hash/sha3/.*' \
'ext/lexbor/lexbor/.*' \
'ext/mbstring/libmbfl/.*' \
'ext/opcache/jit/ir/.*' \
'ext/pcre/pcre2lib/.*' \
'ext/uri/uriparser/.*'

# These patterns have implicit ^/$ anchors.
GCOVR_EXCLUDE_LINES_BY_PATTERNS = \
'.*\b(ZEND_PARSE_PARAMETERS_(START|END|NONE)|Z_PARAM_).*' \
'\s*(default:\s*)?ZEND_UNREACHABLE\(\);\s*'

lcov: lcov-html

php_lcov.info:
Expand All @@ -56,15 +39,11 @@ gcovr-html:
@echo "Generating gcovr HTML"
@rm -rf gcovr_html/
@mkdir gcovr_html
gcovr -sr . -o gcovr_html/index.html --html --html-details --exclude-unreachable-branches --exclude-throw-branches \
$(foreach pattern, $(GCOVR_EXCLUDE_LINES_BY_PATTERNS), --exclude-lines-by-pattern $(pattern)) \
$(foreach lib, $(GCOVR_EXCLUDES), -e $(lib))
gcovr -r . -o gcovr_html/index.html --html --html-details

gcovr-xml:
@echo "Generating gcovr XML"
@rm -f gcovr.xml
gcovr -sr . -o gcovr.xml --xml --exclude-unreachable-branches --exclude-throw-branches \
$(foreach pattern, $(GCOVR_EXCLUDE_LINES_BY_PATTERNS), --exclude-lines-by-pattern $(pattern)) \
$(foreach lib, $(GCOVR_EXCLUDES), -e $(lib))
gcovr -r . -o gcovr.xml --xml

.PHONY: gcovr-html lcov-html php_lcov.info
5 changes: 4 additions & 1 deletion ext/curl/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ if (PHP_CURL != "no") {
SETUP_ZLIB_LIB("curl", PHP_CURL) &&
(CHECK_LIB("normaliz.lib", "curl", PHP_CURL) &&
CHECK_LIB("libssh2.lib", "curl", PHP_CURL) &&
CHECK_LIB("nghttp2.lib", "curl", PHP_CURL))
CHECK_LIB("nghttp2.lib", "curl", PHP_CURL) &&
CHECK_LIB("brotlidec.lib", "curl", PHP_CURL) &&
CHECK_LIB("brotlicommon.lib", "curl", PHP_CURL) &&
CHECK_LIB("libzstd.lib", "curl", PHP_CURL))
) {
EXTENSION("curl", "interface.c multi.c share.c curl_file.c");
AC_DEFINE('HAVE_CURL', 1, "Define to 1 if the PHP extension 'curl' is available.");
Expand Down
4 changes: 2 additions & 2 deletions ext/curl/tests/check_win_config.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ UNIX_SOCKETS => %r(Yes|No)%r
PSL => No
HTTPS_PROXY => Yes
MULTI_SSL => %s
BROTLI => %s
BROTLI => Yes
ALTSVC => Yes
HTTP3 => No
UNICODE => No
ZSTD => No
ZSTD => Yes
HSTS => Yes
GSASL => No
Protocols => dict, file, ftp, ftps, gopher, %r(gophers, )?%rhttp, https, imap, imaps, ldap, ldaps, %r(mqtt, )?%rpop3, pop3s, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp%r(, ws)?(, wss)?%r
Expand Down
2 changes: 1 addition & 1 deletion ext/standard/type.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ PHP_FUNCTION(settype)
convert_to_long(ptr);
} else if (zend_string_equals_ci(type, ZSTR_KNOWN(ZEND_STR_FLOAT))) {
convert_to_double(ptr);
} else if (zend_string_equals_ci(type, ZSTR_KNOWN(ZEND_STR_DOUBLE))) { /* deprecated */
} else if (zend_string_equals_ci(type, ZSTR_KNOWN(ZEND_STR_DOUBLE))) {
convert_to_double(ptr);
} else if (zend_string_equals_ci(type, ZSTR_KNOWN(ZEND_STR_STRING))) {
convert_to_string(ptr);
Expand Down
2 changes: 1 addition & 1 deletion ext/xmlreader/php_xmlreader.c
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ PHP_METHOD(XMLReader, moveToAttributeNo)
}
/* }}} */

/* {{{ Positions reader at attribute spcified by name and namespaceURI.
/* {{{ Positions reader at attribute specified by name and namespaceURI.
Returns TRUE on success and FALSE on failure */
PHP_METHOD(XMLReader, moveToAttributeNs)
{
Expand Down
2 changes: 1 addition & 1 deletion ext/xmlreader/tests/expand.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
XMLReader: Expand into existing DOM documet
XMLReader: Expand into existing DOM document
--EXTENSIONS--
xmlreader
dom
Expand Down
2 changes: 1 addition & 1 deletion ext/xmlwriter/php_xmlwriter.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ PHP_FUNCTION(xmlwriter_write_element)
}
/* }}} */

/* {{{ Write full namesapced element tag - returns FALSE on error */
/* {{{ Write full namespaced element tag - returns FALSE on error */
PHP_FUNCTION(xmlwriter_write_element_ns)
{
xmlTextWriterPtr ptr;
Expand Down
2 changes: 1 addition & 1 deletion ext/xmlwriter/tests/bug39504.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Bug #39504 (xmlwriter_write_dtd_entity() creates Attlist tag, not enity)
Bug #39504 (xmlwriter_write_dtd_entity() creates Attlist tag, not entity)
--EXTENSIONS--
xmlwriter
--FILE--
Expand Down
9 changes: 7 additions & 2 deletions ext/zend_test/observer.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,8 @@ static ZEND_INI_MH(zend_test_observer_OnUpdateCommaList)
}
if (stage != PHP_INI_STAGE_STARTUP && stage != PHP_INI_STAGE_ACTIVATE && stage != PHP_INI_STAGE_DEACTIVATE && stage != PHP_INI_STAGE_SHUTDOWN) {
ZEND_HASH_FOREACH_STR_KEY(*p, funcname) {
if ((func = zend_hash_find_ptr(EG(function_table), funcname))) {
if ((func = zend_hash_find_ptr(EG(function_table), funcname))
&& RUN_TIME_CACHE(&func->common)) {
void *old_handler;
zend_observer_remove_begin_handler(func, observer_begin, (zend_observer_fcall_begin_handler *)&old_handler);
zend_observer_remove_end_handler(func, observer_end, (zend_observer_fcall_end_handler *)&old_handler);
Expand All @@ -357,7 +358,11 @@ static ZEND_INI_MH(zend_test_observer_OnUpdateCommaList)
zend_string_release(str);
if (stage != PHP_INI_STAGE_STARTUP && stage != PHP_INI_STAGE_ACTIVATE && stage != PHP_INI_STAGE_DEACTIVATE && stage != PHP_INI_STAGE_SHUTDOWN) {
ZEND_HASH_FOREACH_STR_KEY(*p, funcname) {
if ((func = zend_hash_find_ptr(EG(function_table), funcname))) {
if ((func = zend_hash_find_ptr(EG(function_table), funcname))
&& RUN_TIME_CACHE(&func->common) && *ZEND_OBSERVER_DATA(func)) {
void *old_handler;
zend_observer_remove_begin_handler(func, observer_begin, (zend_observer_fcall_begin_handler *)&old_handler);
zend_observer_remove_end_handler(func, observer_end, (zend_observer_fcall_end_handler *)&old_handler);
zend_observer_add_begin_handler(func, observer_begin);
zend_observer_add_end_handler(func, observer_end);
}
Expand Down
18 changes: 18 additions & 0 deletions ext/zend_test/tests/gh16811.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--TEST--
GH-16811 (Segmentation fault in zend observer)
--EXTENSIONS--
zend_test
--INI--
zend_test.observer.enabled=1
zend_test.observer.show_output=1
zend_test.observer.observe_function_names=a,d
--FILE--
<?php
var_dump(ini_set("zend_test.observer.observe_function_names", "bar"));
function d() {}
?>
--EXPECTF--
<!-- init '%s' -->
<!-- init ini_set() -->
<!-- init var_dump() -->
string(3) "a,d"
17 changes: 17 additions & 0 deletions ext/zend_test/tests/gh16811_observe_all.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
--TEST--
GH-16811 (Assertion failure adding duplicate observer handler)
--EXTENSIONS--
zend_test
--INI--
zend_test.observer.enabled=1
zend_test.observer.observe_all=1
zend_test.observer.show_output=0
--FILE--
<?php
function foo() {}
foo();
ini_set("zend_test.observer.observe_function_names", "foo");
echo "Done\n";
?>
--EXPECT--
Done
19 changes: 19 additions & 0 deletions gcovr.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
print-summary = yes

exclude-throw-branches = yes
exclude-unreachable-branches = yes

exclude = ext/bcmath/libbcmath/.*
exclude = ext/date/lib/.*
exclude = ext/fileinfo/libmagic/.*
exclude = ext/gd/libgd/.*
exclude = ext/hash/sha3/.*
exclude = ext/lexbor/lexbor/.*
exclude = ext/mbstring/libmbfl/.*
exclude = ext/opcache/jit/ir/.*
exclude = ext/pcre/pcre2lib/.*
exclude = ext/uri/uriparser/.*

# These patterns have implicit ^/$ anchors.
exclude-lines-by-pattern = .*\b(ZEND_PARSE_PARAMETERS_(START|END|NONE)|Z_PARAM_).*
exclude-lines-by-pattern = \s*(default:\s*)?ZEND_UNREACHABLE\(\);\s*