Edit report at https://bugs.php.net/bug.php?id=61311&edit=1

 ID:                 61311
 Comment by:         kavi at postpro dot net
 Reported by:        icedglow at email dot it
 Summary:            provide a way to enable exceptions for all warning
                     in DateTime class
 Status:             Open
 Type:               Feature/Change Request
 Package:            Date/time related
 Operating System:   any
 PHP Version:        5.4.0
 Block user comment: N
 Private report:     N

 New Comment:

The statement in the example 'works' in 5.3.3.

Here's what I'm using in my unit test for the presence of this bug:


$a = DateTime::createFromFormat('H:i:s', 'asdf');  // should throw Exception


The statement actually returns false and does not throw an exception.


Previous Comments:
------------------------------------------------------------------------
[2012-03-07 05:28:34] icedglow at email dot it

Description:
------------
hello

$a = DateTime::createFromFormat("H:i", "1:1");

doesn't create the istance because minutes part require two digits

but this code doesn't produce a php warning or notice, even an exception, none 
at 
all

it returns false, but it is a constructor...

so why I need to use the if(), when I'm in a try{} block?

I was thinking that php's new way was "converting to OOP".



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=61311&edit=1

Reply via email to