ID: 48149 Updated by: f...@php.net Reported By: lists at reptiliannature dot org -Status: Open +Status: Verified Bug Type: Date/time related Operating System: ALL PHP Version: 5.3.0RC1 New Comment:
Still present in 5.3.0RC2 Previous Comments: ------------------------------------------------------------------------ [2009-05-04 21:20:13] lists at reptiliannature dot org Description: ------------ This bug seems to be identical to http://bugs.php.net/bug.php?id=45545 which was marked closed. It appears than when part of the interval is greater than 9999 the DateInterval throws an exception. DateInterval::__construct(): Unknown or bad format (PT10000M); This happens with years, days, hours, minutes, and seconds Reproduce code: --------------- $i = 900; while ($i) { try { $di = new DateInterval('PT' . $i . 'M'); } catch (exception $e) { var_dump($i); echo $e->getMessage(); break; } $i++; } Expected result: ---------------- I would expect to have a DateInterval object with interval ('PT1000M') or greater. Actual result: -------------- DateInterval::__construct(): Unknown or bad format (PT10000M); ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=48149&edit=1