@@ -35,7 +35,7 @@ public function __construct($time = null, $tz = null)
3535
3636        /* Bug #14381 Catch malformed offset - which doesn't cause 
3737           DateTime to throw exception. */ 
38-         if  (substr (rtrim ($ time5 ) === ' 0000 ' ) {
38+         if  ($ time  !==  null  &&  substr (rtrim ($ time5 ) === ' 0000 ' ) {
3939            $ timesubstr (trim ($ time0 , strlen (trim ($ time5 ) . ' +0000 ' ;
4040            try  {
4141                if  ($ bug_67118
@@ -48,15 +48,15 @@ public function __construct($time = null, $tz = null)
4848
4949        try  {
5050            if  ($ bug_67118
51-                 new  DateTime ($ time$ tz
51+                 new  DateTime ($ time ===  null  ?  ' now '  :  $ time $ tz
5252            }
53-             parent ::__construct ($ time$ tz
53+             parent ::__construct ($ time ===  null  ?  ' now '  :  $ time $ tz
5454            return ;
5555        } catch  (Exception $ e
5656
5757        /* Check for malformed day-of-week parts, usually incorrectly 
5858         *  localized. E.g. Fr, 15 Apr 2016 15:15:09 +0000 */ 
59-         if  (!preg_match ("/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun),/ " , $ time
59+         if  ($ time  !==  null  &&  !preg_match ("/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun),/ " , $ time
6060            $ timepreg_replace ("/^(\S*,)/ " , '' , $ time1 , $ i
6161            if  ($ i
6262                try  {
@@ -70,7 +70,7 @@ public function __construct($time = null, $tz = null)
7070        }
7171
7272        /* Bug #5717 - Check for UT vs. UTC. */ 
73-         if  (substr (rtrim ($ time3 ) === ' UT ' ) {
73+         if  ($ time  !==  null  &&  substr (rtrim ($ time3 ) === ' UT ' ) {
7474            try  {
7575                if  ($ bug_67118
7676                    new  DateTime ($ time'C ' , $ tz
0 commit comments