com php-src: Fixed bug #76462 Undefined property: DateInterval::$f: ext/date/php_date.c ext/date/tests/bug76462.p hpt

From: Date: Tue, 12 Jun 2018 13:30:14 +0000
Subject: com php-src: Fixed bug #76462 Undefined property: DateInterval::$f: ext/date/php_date.c ext/date/tests/bug76462.p hpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-102131@lists.php.net to get a copy of this message
Commit: 72128294352e8b8dbbfe43f85cb5bf79a24a9332 Author: Anatol Belski <ab@php.net> Tue, 12 Jun 2018 15:30:14 +0200 Parents: 6c9db02ff7812c298d1e7e292ba731d9d3a66790 Branches: PHP-7.1 PHP-7.2 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=72128294352e8b8dbbfe43f85cb5bf79a24a9332 Log: Fixed bug #76462 Undefined property: DateInterval::$f Bugs: https://bugs.php.net/76462 Changed paths: M ext/date/php_date.c A ext/date/tests/bug76462.phpt Diff: diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 7c28f1b..955b7e9 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -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. */ diff --git a/ext/date/tests/bug76462.phpt b/ext/date/tests/bug76462.phpt new file mode 100644 index 0000000...096fa5b --- /dev/null +++ b/ext/date/tests/bug76462.phpt @@ -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)

« previous php.cvs (#102131) next »