> On 14 Nov 2014, at 07:39, Mathieu D. <mathieudme...@gmail.com> wrote:
> 
> PHP is lacking of some elemental exceptions. One obvious example would be
> FileNotFoundException.
> 
> Java has a FileNotFoundException,
> C# has a FileNotFoundException,
> Python has a FileNotFoundError, ...
> 
> Why doesn't PHP provide a bundled FileNotFoundException or at least a more
> general IOException?

Presumably this is because most of PHP’s I/O stuff still uses procedural APIs 
with error return values.

One of the things I’d like to see happen, but don’t have the time to do myself, 
is get rid of the IS_RESOURCE type from PHP for PHP 7, and replace all 
instances with objects. As part of this, we’d need to convert streams to using 
objects, which would give us an opportunity to create a new OOP stream API, 
learning from our past mistakes and which uses exceptions. As part of that, I’m 
sure we’d add some I/O exceptions.

--
Andrea Faulds
http://ajf.me/





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

Reply via email to