From:
Operating system: Ubuntu 10.04
PHP version: 5.3.3
Package: Date/time related
Bug Type: Bug
Bug description:Can't use new properties in class extended from DateInterval
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
--
Edit bug report at http://bugs.php.net/bug.php?id=52738&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=52738&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=52738&r=trysnapshot53
Try a snapshot (trunk):
http://bugs.php.net/fix.php?id=52738&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=52738&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=52738&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=52738&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=52738&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=52738&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=52738&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=52738&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=52738&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=52738&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=52738&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=52738&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52738&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=52738&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=52738&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=52738&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=52738&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=52738&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=52738&r=mysqlcfg