Can't use new properties in class extended from DateInterval
| Bug #52738 | Can't use new properties in class extended from DateInterval | ||||
|---|---|---|---|---|---|
| Submitted: | 2010-08-30 12:50 UTC | Modified: | 2011-01-24 03:32 UTC | ||
| From: | camka at hot dot ee | Assigned: | stas (profile) | ||
| Status: | Closed | Package: | Date/time related | ||
| PHP Version: | 5.3.3 | OS: | Ubuntu 10.04 | ||
| Private report: | No | CVE-ID: | None | ||
[2010-08-30 12:50 UTC] camka at hot dot ee
Description:
------------
When trying to set or get any pre-defined property other then y/m/d/h/i/s in a class extended from built-in DateInterval, the error tells you that the property is not known.
Also tried with
PHP 5.3.4-dev (cli) (built: Aug 30 2010 13:48:30)
Test script:
---------------
<?php
class di extends DateInterval {
public $unit = 1;
}
$I = new di('P10D');
echo $I->unit;
Expected result:
----------------
1
Actual result:
--------------
Fatal error: main(): Unknown property (unit) in /var/www/test/inter.php on line 7
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2011-01-24 03:32 UTC] stas@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: stas
[2011-01-24 03:32 UTC] stas@php.net