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
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: 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 04:01:31 2025 UTC