Hello, interals...

Kind of stumbled onto this by accident. Some kind of FD leak in streams. In
the current HEAD (and 5.0.0 RC1, I suppose, although I didn't specifically
test that, just my CVS checkout)...

class.one.php:

<?php class one {} ?>

class.two.php:

<?php class two extends one {} ?>

foo.php:

<?php
function __autoload($c)
{
    require('bug_class.' . $c . '.php');
}

require('class.two.php');

$a = new two;
?>


[EMAIL PROTECTED] $ php5 foo.php

Warning: __autoload(bug_class.one.php): failed to open stream: No such file
or directory in /home/jay/bug/class.two.php on line 1

Fatal error: __autoload(): Failed opening required
'bug_class.one.php' (include_path='/usr/local/lib/php:.') 
in /home/jay/bug/class.two.php on line 3
/home/jay/setup/php/php5/main/streams/streams.c(371) : Stream of type
'STDIO' 0x4014dfac (path:class.two.php) was not closed


Getting rid of the line that reads "require('class.two.php');" gets rid of
the leak. The "bug_class." in autoload() is also not a typo; fixing that
also gets rid of the leak (along with the warnings and such, too,
obviously.)

No idea what the problem is here, as my knowledge of the streams code is
pitiful.

J

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

Reply via email to