Skip to content

Commit

Permalink
Merge pull request phacility#44 from skilld-labs/php8
Browse files Browse the repository at this point in the history
Fix curl PHP 8 compatibility
  • Loading branch information
longxinH authored Aug 21, 2020
2 parents 8fbfcfa + 1cafd30 commit 020c7f8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 32 deletions.
1 change: 0 additions & 1 deletion extension/tests/xhprof_012.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ XHProf: Test Curl Additional Info
Author: longxinhui
--SKIPIF--
<?php if (!extension_loaded("curl")) print 'skip'; ?>
<?php if (PHP_VERSION_ID >= 80000) echo "skip test for php >= 8"; ?>
--INI--
xhprof.collect_additional_info = 1
--FILE--
Expand Down
31 changes: 0 additions & 31 deletions extension/tests/xhprof_012_8.phpt

This file was deleted.

4 changes: 4 additions & 0 deletions extension/xhprof.c
Original file line number Diff line number Diff line change
Expand Up @@ -1516,7 +1516,11 @@ zend_string *hp_trace_callback_curl_exec(zend_string *symbol, zend_execute_data
zval func, retval, *option;
zval *arg = ZEND_CALL_ARG(data, 1);

#if PHP_VERSION_ID < 80000
if (arg == NULL || Z_TYPE_P(arg) != IS_RESOURCE) {
#else
if (arg == NULL || Z_TYPE_P(arg) != IS_OBJECT) {
#endif
return symbol;
}

Expand Down

0 comments on commit 020c7f8

Please sign in to comment.