Merge branch 'PHP-7.2'

* PHP-7.2:
  Fixed bug #76462 Undefined property: DateInterval::$f
This commit is contained in:
Anatol Belski 2018-06-12 15:31:49 +02:00
commit c9fc0095ce
2 changed files with 17 additions and 0 deletions

View File

@ -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. */

View 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)