mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fix reference handling of IntlTimeZone::getCanonicalID/intltz_get_canonical_id
Closes GH-18469.
This commit is contained in:
parent
e3105f5f1e
commit
a090e59b37
2 changed files with 20 additions and 3 deletions
19
ext/intl/tests/intltz_get_canonical_id_refs.phpt
Normal file
19
ext/intl/tests/intltz_get_canonical_id_refs.phpt
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
--TEST--
|
||||||
|
IntlTimeZone::getCanonicalID: refs test
|
||||||
|
--EXTENSIONS--
|
||||||
|
intl
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
class Test {
|
||||||
|
public string $prop = "a";
|
||||||
|
}
|
||||||
|
$test = new Test;
|
||||||
|
$ref =& $test->prop;
|
||||||
|
print_R(intltz_get_canonical_id('Portugal', $ref));
|
||||||
|
var_dump($test);
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
Europe/Lisbonobject(Test)#1 (1) {
|
||||||
|
["prop"]=>
|
||||||
|
&string(1) "1"
|
||||||
|
}
|
|
@ -291,9 +291,7 @@ U_CFUNC PHP_FUNCTION(intltz_get_canonical_id)
|
||||||
RETVAL_NEW_STR(u8str);
|
RETVAL_NEW_STR(u8str);
|
||||||
|
|
||||||
if (is_systemid) { /* by-ref argument passed */
|
if (is_systemid) { /* by-ref argument passed */
|
||||||
ZVAL_DEREF(is_systemid);
|
ZEND_TRY_ASSIGN_REF_BOOL(is_systemid, isSystemID);
|
||||||
zval_ptr_dtor(is_systemid);
|
|
||||||
ZVAL_BOOL(is_systemid, isSystemID);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue