php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17517 ucwords() returns false when it should return ''
Submitted: 2002-05-29 20:08 UTC Modified: 2002-06-17 07:38 UTC
From: darren at flyingcolor dot com Assigned:
Status: Closed Package: Strings related
PHP Version: 4.1.2 OS: Linux and NT4
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: darren at flyingcolor dot com
New email:
PHP Version: OS:

 

 [2002-05-29 20:08 UTC] darren at flyingcolor dot com
ucwords('') returns a type of boolean but it should return ''. This script demonstrates the problem:

<?php
$s="a bc";
$s2=ucwords($s);
echo gettype($s2).":".$s2;
$s='';
$s2=ucwords($s);
echo gettype($s2).":".$s2;
?>

To get around it I do this after the ucwords() call:
  if(!$s2)$s2='';


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-17 07:38 UTC] hholzgra@php.net
fixed in CVS
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Feb 05 03:01:31 2025 UTC