ID:               32171
 Updated by:       [EMAIL PROTECTED]
 Reported By:      jr at terragate dot net
-Status:           Assigned
+Status:           Feedback
 Bug Type:         SPL related
-Operating System: x86 linux
+Operating System: *
-PHP Version:      5CVS-2005-03-05
+PHP Version:      5.*
 Assigned To:      helly
 New Comment:

Did i get that correct that all works frin when you use instanceof ? If
so all is fine. Also what happens if you stick with is_a but set error
mode to 0?


Previous Comments:
------------------------------------------------------------------------

[2005-03-07 11:25:40] jr at terragate dot net

I tested the instanceof segfault against the 5.1 branch and it
segfaults too. 

But I had to change a is_a in HTTP/Request.php to instanceof because
the 'notice exception' was thrown there this time.

I wasn't able to reproduce the segfault with a smaller test case by
using HTTP/Request.php myself (PEAR's WebDAV Wrapper) nor using
instanceof inside a small stream wrapper.

Initially I tested the bug with 5.0.3 but tried a snap a few hours
later. Sorry for not updating the version field.

------------------------------------------------------------------------

[2005-03-06 16:21:35] [EMAIL PROTECTED]

Please don't open more reports about same issue. (and when you report
bugs, put the LATEST version in the 'Version' field' so we don't have
to waste time asking if you tested the latest version..)


------------------------------------------------------------------------

[2005-03-04 18:48:59] jr at terragate dot net

I already tested the bug against yesterdays snapshot of 
5.0.x.

Using the 5.1.0 snap does not resolve the exception 
issue. 

I will test the instanceof segfault on monday against 
the 5.1 branch.

Maybe I should create a seperate bug for it.

 

voyager:~/Downloads/php5-200503041530/result/bin jr$ 
uname -a
Darwin voyager.starbase12.sfn 7.8.0 Darwin Kernel 
Version 7.8.0: Wed Dec 22 14:26:17 PST 2004; root:xnu/
xnu-517.11.1.obj~1/RELEASE_PPC  Power Macintosh powerpc
voyager:~/Downloads/php5-200503041530/result/bin jr$ ./
php -v
PHP 5.1.0-dev (cgi) (built: Mar  4 2005 18:33:26) 
(DEBUG)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.1.0-dev, Copyright (c) 1998-2004 Zend 
Technologies
voyager:~/Downloads/php5-200503041530/result/bin jr$ ./
php test.php 
Content-type: text/html
X-Powered-By: PHP/5.1.0-dev

<br />
<b>Fatal error</b>:  Uncaught exception 'Exception' with 
message 'is_a(): Deprecated. Please use the instanceof 
operator' in /Volumes/Data/Users/jr/Downloads/php5
-200503041530/result/bin/test.php:6
Stack trace:
#0 /Volumes/Data/Users/jr/Downloads/php5-200503041530/
result/bin/test.php(12): StreamWrapper-
>dir_opendir(NULL, 'AKnownOrUnknown...')
#1 /Volumes/Data/Users/jr/Downloads/php5-200503041530/
result/bin/test.php(12): DirectoryIterator-
>__construct('test://path/', 4)
#2 {main}
  thrown in <b>/Volumes/Data/Users/jr/Downloads/php5
-200503041530/result/bin/test.php</b> on line <b>6</
b><br />
/Volumes/Data/Users/jr/Downloads/php5-200503041530/
result/bin/test.php(6) : Fatal error - Uncaught 
exception 'Exception' with message 'is_a(): Deprecated. 
Please use the instanceof operator' in /Volumes/Data/
Users/jr/Downloads/php5-200503041530/result/bin/
test.php:6
Stack trace:
#0 /Volumes/Data/Users/jr/Downloads/php5-200503041530/
result/bin/test.php(12): StreamWrapper-
>dir_opendir(NULL, 'AKnownOrUnknown...')
#1 /Volumes/Data/Users/jr/Downloads/php5-200503041530/
result/bin/test.php(12): DirectoryIterator-
>__construct('test://path/', 4)
#2 {main}
  thrown

------------------------------------------------------------------------

[2005-03-04 16:34:34] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip



------------------------------------------------------------------------

[2005-03-03 17:13:03] jr at terragate dot net

After digging a while in the PHP source I found the reason for the
thrown exception.

The SPL sets the php error handling mode to EH_THROW. 

But currently php_error_cb throws everything as exception, even notices
(E_NOTICE), warnings (E_WARNING) and strict warnings caused by
E_STRICT.

IMHO those shouldn't be thrown as exception. 

I've made a path that fixes this. E_NOTICE, E_WARNING and E_STRICT will
be handled the same way as in EH_NORMAL.

Probably E_USER_NOTICE and E_USER_WARNING should be added.

http://www.terragate.net/~jr/no_notices_and_warnings_as_exception.diff

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/32171

-- 
Edit this bug report at http://bugs.php.net/?id=32171&edit=1

Reply via email to