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


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

[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

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

[2005-03-03 15:05:51] jr at terragate dot net

I was able to create a smaller example for the exception:

<?php

class StreamWrapper
{
  public function dir_opendir($path, $options) {
    return is_a(null, 'AKnownOrUnknownClass');
  }

}

stream_wrapper_register('test', 'StreamWrapper');
$it = new DirectoryIterator('test://path/');

?>

This will raise the following exception:

Fatal error: Uncaught exception 'Exception' with message 'is_a():
Deprecated. Please use the instanceof operator' in
/var/www/localhost/htdocs/splexception.php:6
Stack trace:
#0 /var/www/localhost/htdocs/splexception.php(6): is_a(NULL,
'AKnownOrUnknown...')
#1 /var/www/localhost/htdocs/splexception.php(13):
StreamWrapper->dir_opendir('test://path/', 4)
#2 /var/www/localhost/htdocs/splexception.php(13):
DirectoryIterator->__construct('test://path/')
#3 {main}
  thrown in /var/www/localhost/htdocs/splexception.php on line 6


This problem does not occur when using opendir so this seems to be SPL
related. 

Category changed accordingly 

I wasn't able to reproduce the instanceof crash with this small
snippet.

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

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