mirror of
https://github.com/php/php-src.git
synced 2024-11-28 12:26:37 +08:00
Fixed cloning in ext/intl classes; master specific
This commit is contained in:
parent
befe4ab479
commit
dacd11ea89
24
ext/intl/tests/bug62915.phpt
Normal file
24
ext/intl/tests/bug62915.phpt
Normal file
@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Bug #62915: incomplete cloning of IntlTimeZone objects
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl'))
|
||||
die('skip intl extension not enabled');
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class foo extends IntlTimeZone {
|
||||
public $foo = 'test';
|
||||
|
||||
public function __construct() { }
|
||||
}
|
||||
|
||||
$x = new foo;
|
||||
|
||||
try {
|
||||
$z = clone $x;
|
||||
} catch (Exception $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
--EXPECT--
|
||||
string(39) "Cannot clone unconstructed IntlTimeZone"
|
@ -225,7 +225,7 @@ static zend_object_value TimeZone_clone_obj(zval *object TSRMLS_DC)
|
||||
to_orig = (TimeZone_object*)zend_object_store_get_object(object TSRMLS_CC);
|
||||
intl_error_reset(TIMEZONE_ERROR_P(to_orig) TSRMLS_CC);
|
||||
|
||||
ret_val = TimeZone_ce_ptr->create_object(TimeZone_ce_ptr TSRMLS_CC);
|
||||
ret_val = TimeZone_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC);
|
||||
to_new = (TimeZone_object*)zend_object_store_get_object_by_handle(
|
||||
ret_val.handle TSRMLS_CC);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user