Re: svn: /phpdoc/en/trunk/language/predefined/ errorexception.xml

From: Date: Thu, 05 Mar 2015 21:19:58 +0000
Subject: Re: svn: /phpdoc/en/trunk/language/predefined/ errorexception.xml
References: 1 2  Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-13128@lists.php.net to get a copy of this message
On Thu, Mar 5, 2015 at 2:29 AM, Peter Cowburn <petercowburn@gmail.com> wrote: > On 5 March 2015 at 09:13, TAKAGI Masahiro <takagi@php.net> wrote: > >> takagi Thu, 05 Mar 2015 09:13:29 +0000 >> >> Revision: >> http://svn.php.net/viewvc?view=revision&revision=336038 >> >> Log: >> Example #1: correct the order of parameters >> > > I have reverted this commit. Passing $errno as the $severity argument (the > 3rd parameter) is deliberate and should stay. The "severity" is a property > specific to ErrorException, which is not present in other Exceptions, and > is designed to map to our E_* constants. > > >> >> $errno should be the 2nd parameter. >> > > We *may* want to also pass $errno as the $code argument. That's up for > debate. This is also not the first time that the $code and $severity > arguments have been swapped around in that example; I can only attribute > this as a failing in the current documentation in making it abundantly > clear what the ErrorException::$severity is meant to represent. Renaming the $errno variable to $severity would resolve this - sorry for being bad at naming things! As-is, the $errno totally makes it look like it should be passed as $errcode -Hannes

« previous php.doc.cvs (#13128) next »