Bug #12092 Updated: pathinfo fails to return when passed a file with no extension

From: Date: Thu, 12 Jul 2001 10:30:08 +0000
Subject: Bug #12092 Updated: pathinfo fails to return when passed a file with no extension
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-59817@lists.php.net to get a copy of this message
ID: 12092
Updated by: joey
Reported By: aidan@reality.co.uk
Old Status: Open
Status: Closed
Bug Type: Any
Operating System: GNU/Linux
PHP Version: 4.0.4pl1
New Comment:

Try upgrading your PHP. I get your "expected behavior"
from 4.0.7-dev.

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

[2001-07-12 06:15:38] aidan@reality.co.uk

<? 
$info = pathinfo("/foo/bar");
echo ($info["dirname"]."<br>\n");
echo ($info["basename"]."<br>\n");
echo ($info["extension"]."<br>\n");
?>

This should print:
/foo<br>
bar<br>
<br>

but will not return.

<?
$info = pathinfo("/foo/bar.baz");
echo ($info["dirname"]."<br>\n");
echo ($info["basename"]."<br>\n");
echo ($info["extension"]."<br>\n");
?>

prints<?
$info = pathinfo("/foo/bar.");
echo ($info["dirname"]."<br>\n");
echo ($info["basename"]."<br>\n");
echo ($info["extension"]."<br>\n");
?>
/foo<br>
bar.baz<br>
baz<br>

as expected and

<?
$info = pathinfo("/foo/bar.");
echo ($info["dirname"]."<br>\n");
echo ($info["basename"]."<br>\n");
echo ($info["extension"]."<br>\n");
?>

prints
/foo<br>
bar.<br>
<br>

as expected, it's only the case where there is no trailing . that pathinfo fails to work.

The configure line is:

 './configure' '--with-config-file-path=/www/conf'
'--enable-track-vars' '--with-apxs=/usr/apache/bin/apxs' '--with-oci8'
'--enable-ftp' '--with-mysql' '--with-pgsql' '--enable-xml'
'--enable-inline-optimization' '--disable-debug' '--with-zlib'
'--enable-shared' '--with-gnu-ld' '--with-mcrypt'

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



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=12092&edit=1



Thread (2 messages)

« previous php.dev (#59817) next »