php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1317 max() works strangely, dirname() works strangely
Submitted: 1999-04-15 00:07 UTC Modified: 1999-06-01 15:39 UTC
From: fuf at fuf dot sh dot cvut dot cz Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0.7 OS: linux-2.2.5-ac3
Private report: No CVE-ID: None
 [1999-04-15 00:07 UTC] fuf at fuf dot sh dot cvut dot cz
max() bug: $str="very long string"; max(strpos($str,"long"),strpos($str,"LONG")) returns 0!!!!!
max() does work correctly when given numbers as parameters
looks like the number conversion doesn't work for it

dirname() bug: dirname('index.html') should return '.'
instead it returns 'index.html' !!!

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-06-01 15:39 UTC] jim at cvs dot php dot net
strpos() returns false when the needle isn't found,
so you aren't giving max() a number of integers.

dirname() is not being passed a path to a file,
so its return value is as correct as it can get.

Bugs about different functions should be reported
as seperate bugs.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 09:00:02 2026 UTC