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 Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or 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

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-17 07:38 UTC] hholzgra@php.net
fixed in CVS
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Mar 03 11:01:29 2024 UTC