#30360 [Opn]: empty string evaluates to string(0) php4.3.4 to string(1) in 5.0.2

From: Date: Fri, 08 Oct 2004 09:58:08 +0000
Subject: #30360 [Opn]: empty string evaluates to string(0) php4.3.4 to string(1) in 5.0.2
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-67274@lists.php.net to get a copy of this message
ID: 30360 Updated by: derick@php.net Reported By: daniel at spector dot ie Status: Open Bug Type: Strings related Operating System: Win2K PHP Version: 5.0.2 New Comment: Works fine here: derick@kossu:~$ php-5.0dev <?php $s = ''; var_dump($s); ?> string(0) "" Previous Comments: ------------------------------------------------------------------------ [2004-10-08 11:52:50] daniel at spector dot ie Description: ------------ PHP4.3.4 to PHP5.0.2 empty('') string evaluates to string(0) on 4.3.4(x?) and string(1) on php5.0.2. Can be reproduced with code below. Thanks alot in advance. Reproduce code: --------------- //an empty string $suffix=''; var_dump($suffix); $msg = (empty($suffix)) ? 'php4' : 'php5'; echo $msg; /* * on php4 var_dump returns string(0) msg returns php4 * on php5 var_dump returns string(1) msg returns php5 */ ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30360&edit=1

« previous php.bugs (#67274) next »