1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Fixed bug #76462 Undefined property: DateInterval::$f

This commit is contained in:
Anatol Belski
2018-06-12 15:30:14 +02:00
parent 6c9db02ff7
commit 7212829435
2 changed files with 17 additions and 0 deletions

View File

@@ -4276,6 +4276,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)