php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #17855 version_compare() to force to string, input params
Submitted: 2002-06-19 19:28 UTC Modified: 2002-06-19 19:40 UTC
From: cox at idecnet dot com Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 4.2.1 OS: Linux RH
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: cox at idecnet dot com
New email:
PHP Version: OS:

 

 [2002-06-19 19:28 UTC] cox at idecnet dot com
# phpcli -r "var_dump(version_compare(0.9, 0.90, 'eq'));"
bool(true)
# phpcli -r "var_dump(version_compare('0.9', '0.90', 'eq'));"
bool(false)

Would be nice if version_compare could force the input params to be strings instead of doing the comparation with int's. Sorry if I dream too much.

-- Tomas V.V.Cox

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-19 19:40 UTC] sniper@php.net
0.9 != 0.90

And the function does require strings..

--Jani

 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Jun 18 14:00:02 2026 UTC