Skip to content

Commit 1cafd30

Browse files
committed
Fix curl PHP 8 compatibility
In 8+ curl using objects instead of resources php/php-src#5402
1 parent 8fbfcfa commit 1cafd30

File tree

3 files changed

+4
-32
lines changed

3 files changed

+4
-32
lines changed

extension/tests/xhprof_012.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ XHProf: Test Curl Additional Info
33
Author: longxinhui
44
--SKIPIF--
55
<?php if (!extension_loaded("curl")) print 'skip'; ?>
6-
<?php if (PHP_VERSION_ID >= 80000) echo "skip test for php >= 8"; ?>
76
--INI--
87
xhprof.collect_additional_info = 1
98
--FILE--

extension/tests/xhprof_012_8.phpt

Lines changed: 0 additions & 31 deletions
This file was deleted.

extension/xhprof.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,7 +1516,11 @@ zend_string *hp_trace_callback_curl_exec(zend_string *symbol, zend_execute_data
15161516
zval func, retval, *option;
15171517
zval *arg = ZEND_CALL_ARG(data, 1);
15181518

1519+
#if PHP_VERSION_ID < 80000
15191520
if (arg == NULL || Z_TYPE_P(arg) != IS_RESOURCE) {
1521+
#else
1522+
if (arg == NULL || Z_TYPE_P(arg) != IS_OBJECT) {
1523+
#endif
15201524
return symbol;
15211525
}
15221526

0 commit comments

Comments
 (0)