douxidang9092 2010-02-17 11:54
浏览 59
已采纳

PHP 5.3.1 glob://异常

I'm having problems with the glob:// stream wrapper included in the PHP 5.3.0 version. I'm using the following PHP version:

PHP 5.3.1-0.dotdeb.1 with Suhosin-Patch (cli) (built: Dec 5 2009 20:08:29) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies

When I try to execute the following example from the PHP.net website:

<?php
// Loop over all *.php files in ext/spl/examples/ directory
// and print the filename and its size
$it = new DirectoryIterator("glob://*.php");
foreach($it as $f) {
    printf("%s: %.1FK
", $f->getFilename(), $f->getSize()/1024);
}
?>

Note that I remove the folder from the original example and left only the php extension

I get a PHP error with the following message:

SplFileInfo::getSize(): stat failed for [first php file name].php

While searching at Google about this error I discover that someone had the same problem one year ago, but looks like they fixed it.

So... My question is: Anyone is using glob:// wrapper? Am I doing something wrong? Anyone with the same problem?

Note: I already know I can do the same in other different ways but I want to test the glob:// stream wrapper :)

  • 写回答

3条回答 默认 最新

  • doupin1073 2010-02-18 09:16
    关注

    I sent this bug to PHP Bugs they confirm it's a current PHP 5.3.1 bug.

    They are trying to fix it; see Bug report #51068.

    Thank you all for your answers :)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程