From:             
Operating system: Linux x86_64
PHP version:      5.4SVN-2011-11-04 (SVN)
Package:          Unknown/Other Function
Bug Type:         Bug
Bug description:dir() is missing

Description:
------------
I support dir() support is not dropped.
http://jp.php.net/manual/en/class.dir.php

At first, I noticed this issue on Scientific Linux 6's PHP and not with my
Linux 
box. I though they have patched something for it, but I found it can happen
with 
my Linux box, too.

This happens in PHP 5.3.3, PHP 5.3.8 and php-src-5.4 at least.
This may not be 100% reproducible, but I think chances are high in SL6. PHP
may 
be destroying class entry.

I'm not sure following valgrind result may help or not, but "echo 1" don't

report any leak.

$ USE_ZEND_ALLOC=0 valgrind --leak-check=full ./php -r '$o = new
Dir(".");'
==24918== Memcheck, a memory error detector
==24918== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==24918== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright
info
==24918== Command: ./php -r $o\ =\ new\ Dir(".");
==24918== 
PHP Fatal error:  Class 'Dir' not found in Command line code on line 1

Fatal error: Class 'Dir' not found in Command line code on line 1
==24918== 
==24918== HEAP SUMMARY:
==24918==     in use at exit: 724 bytes in 6 blocks
==24918==   total heap usage: 15,100 allocs, 15,094 frees, 3,101,573 bytes

allocated
==24918== 
==24918== 724 (240 direct, 484 indirect) bytes in 1 blocks are definitely
lost 
in loss record 6 of 6
==24918==    at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
==24918==    by 0x7A6845: _emalloc (zend_alloc.c:2423)
==24918==    by 0x782E75: compile_string (zend_language_scanner.l:717)
==24918==    by 0x7CDC99: zend_eval_stringl (zend_execute_API.c:1181)
==24918==    by 0x7CE00D: zend_eval_stringl_ex (zend_execute_API.c:1240)
==24918==    by 0x7CE097: zend_eval_string_ex (zend_execute_API.c:1251)
==24918==    by 0x93C6E1: do_cli (php_cli.c:1023)
==24918==    by 0x93D625: main (php_cli.c:1356)
==24918== 
==24918== LEAK SUMMARY:
==24918==    definitely lost: 240 bytes in 1 blocks
==24918==    indirectly lost: 484 bytes in 5 blocks
==24918==      possibly lost: 0 bytes in 0 blocks
==24918==    still reachable: 0 bytes in 0 blocks
==24918==         suppressed: 0 bytes in 0 blocks
==24918== 
==24918== For counts of detected and suppressed errors, rerun with: -v
==24918== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 6 from 6)


**********************************************************************

$ USE_ZEND_ALLOC=0 valgrind --leak-check=full ./php -r "echo 1;"
==28266== Memcheck, a memory error detector
==28266== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==28266== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright
info
==28266== Command: ./php -r echo\ 1;
==28266== 
1==28266== 
==28266== HEAP SUMMARY:
==28266==     in use at exit: 0 bytes in 0 blocks
==28266==   total heap usage: 15,078 allocs, 15,078 frees, 3,099,330 bytes

allocated
==28266== 
==28266== All heap blocks were freed -- no leaks are possible
==28266== 
==28266== For counts of detected and suppressed errors, rerun with: -v
==28266== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 6 from 6)


Test script:
---------------
php -r '$o = new Dir(".");'


Expected result:
----------------
PHP should not complain

Actual result:
--------------
Fatal error: Class 'Dir' not found in Command line code on line 1


-- 
Edit bug report at https://bugs.php.net/bug.php?id=60218&edit=1
-- 
Try a snapshot (PHP 5.4):            
https://bugs.php.net/fix.php?id=60218&r=trysnapshot54
Try a snapshot (PHP 5.3):            
https://bugs.php.net/fix.php?id=60218&r=trysnapshot53
Try a snapshot (trunk):              
https://bugs.php.net/fix.php?id=60218&r=trysnapshottrunk
Fixed in SVN:                        
https://bugs.php.net/fix.php?id=60218&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=60218&r=needdocs
Fixed in release:                    
https://bugs.php.net/fix.php?id=60218&r=alreadyfixed
Need backtrace:                      
https://bugs.php.net/fix.php?id=60218&r=needtrace
Need Reproduce Script:               
https://bugs.php.net/fix.php?id=60218&r=needscript
Try newer version:                   
https://bugs.php.net/fix.php?id=60218&r=oldversion
Not developer issue:                 
https://bugs.php.net/fix.php?id=60218&r=support
Expected behavior:                   
https://bugs.php.net/fix.php?id=60218&r=notwrong
Not enough info:                     
https://bugs.php.net/fix.php?id=60218&r=notenoughinfo
Submitted twice:                     
https://bugs.php.net/fix.php?id=60218&r=submittedtwice
register_globals:                    
https://bugs.php.net/fix.php?id=60218&r=globals
PHP 4 support discontinued:          
https://bugs.php.net/fix.php?id=60218&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=60218&r=dst
IIS Stability:                       
https://bugs.php.net/fix.php?id=60218&r=isapi
Install GNU Sed:                     
https://bugs.php.net/fix.php?id=60218&r=gnused
Floating point limitations:          
https://bugs.php.net/fix.php?id=60218&r=float
No Zend Extensions:                  
https://bugs.php.net/fix.php?id=60218&r=nozend
MySQL Configuration Error:           
https://bugs.php.net/fix.php?id=60218&r=mysqlcfg

Reply via email to