php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67626 User exceptions not properly handled
Submitted: 2014-07-15 15:00 UTC Modified: -
From: jpauli@php.net Assigned:
Status: Closed Package: Streams related
PHP Version: 5.5.14 OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jpauli@php.net
New email:
PHP Version: OS:

 

 [2014-07-15 15:00 UTC] jpauli@php.net
Description:
------------
Throwing an exception in userland functions of stream wrappers is not correctly taken care of by the engine.

Test script:
---------------
class MyStream
{
	public function stream_open() { return true; }
	
	public function stream_read()
	{
		throw new Exception('boo!');
		return 42;
	}
	
	public function stream_eof()
	{
		return true;
	}
}


stream_wrapper_register("my", "MyStream");
$fp = fopen('my://foobar', 'r+');
fread($fp, 512);

Expected result:
----------------
Fatal error: Uncaught exception 'Exception' ...

Actual result:
--------------
Warning: fread(): MyStream::stream_eof is not implemented! Assuming EOF in /tmp/streams.php on line 35

Fatal error: Uncaught exception 'Exception'...

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-03-09 06:45 UTC] stas@php.net
Automatic comment on behalf of jpauli
Revision: http://git.php.net/?p=php-src.git;a=commit;h=c4c3dca302df627c492e6ce885b777f21dce9f78
Log: Fix #67626
 [2015-03-09 06:45 UTC] stas@php.net
-Status: Open +Status: Closed
 [2015-03-09 06:45 UTC] stas@php.net
Automatic comment on behalf of jpauli
Revision: http://git.php.net/?p=php-src.git;a=commit;h=7d47d9fe23274d750bee90a4d7f2251ebaaa4e1a
Log: Fix #67626
 [2015-03-09 06:45 UTC] stas@php.net
Automatic comment on behalf of jpauli
Revision: http://git.php.net/?p=php-src.git;a=commit;h=2f06413340655a76024612c5c861b4b8f43555e1
Log: Fix #67626
 [2015-03-09 09:25 UTC] laruence@php.net
Automatic comment on behalf of jpauli
Revision: http://git.php.net/?p=php-src.git;a=commit;h=7d47d9fe23274d750bee90a4d7f2251ebaaa4e1a
Log: Fix #67626
 [2015-03-09 09:25 UTC] laruence@php.net
Automatic comment on behalf of jpauli
Revision: http://git.php.net/?p=php-src.git;a=commit;h=c4c3dca302df627c492e6ce885b777f21dce9f78
Log: Fix #67626
 [2016-07-20 11:39 UTC] davey@php.net
Automatic comment on behalf of jpauli
Revision: http://git.php.net/?p=php-src.git;a=commit;h=2f06413340655a76024612c5c861b4b8f43555e1
Log: Fix #67626
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 13:01:30 2024 UTC