mirror of
https://github.com/php/php-src.git
synced 2024-09-22 10:27:25 +00:00
Merge branch 'PHP-7.2'
* PHP-7.2: Fixed bug #76462 Undefined property: DateInterval::$f
This commit is contained in:
commit
c9fc0095ce
@ -4277,6 +4277,7 @@ static zval *date_interval_get_property_ptr_ptr(zval *object, zval *member, int
|
||||
zend_binary_strcmp("h", sizeof("h") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
|
||||
zend_binary_strcmp("i", sizeof("i") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
|
||||
zend_binary_strcmp("s", sizeof("s") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
|
||||
zend_binary_strcmp("f", sizeof("f") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
|
||||
zend_binary_strcmp("days", sizeof("days") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
|
||||
zend_binary_strcmp("invert", sizeof("invert") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0) {
|
||||
/* Fallback to read_property. */
|
||||
|
16
ext/date/tests/bug76462.phpt
Normal file
16
ext/date/tests/bug76462.phpt
Normal file
@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #76462 Undefined property: DateInterval::$f
|
||||
--FILE--
|
||||
<?php
|
||||
$buggy = new DateInterval('P0Y');
|
||||
$buggy->f += 0.01;
|
||||
|
||||
$ok = new DateInterval('P0Y');
|
||||
$ok->f = $ok->f + 0.01;
|
||||
|
||||
var_dump($buggy->f);
|
||||
var_dump($ok->f);
|
||||
?>
|
||||
--EXPECT--
|
||||
float(0.01)
|
||||
float(0.01)
|
Loading…
Reference in New Issue
Block a user