On 22/10/14 22:12, Zeev Suraski wrote:
> Something like:
> 
> If (!int_convertible($sth)) {  // open to new ideas about the name :)
>       // error out
> }
> $i = (int) $sth;

And this allows each failure with it's own response, while pushing that
problem to an exception requires one builds a tree in the exception with
responses. There is not a single best case solution but putting the
problem this way around looks tidy and keeps processing of each check
grouped ... but is probably not how an exception based user would think?
Adding additional processing to handle a failed $sth test does not break
the work flow!

-- 
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to