Bug #70608 [Opn->Nab]: Echo dosn't print false
| From: | bwoebi@php.net | Date: | Wed, 30 Sep 2015 12:58:20 +0000 |
| Subject: | Bug #70608 [Opn->Nab]: Echo dosn't print false | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-196315@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=70608&edit=1
ID: 70608
Updated by: bwoebi@php.net
Reported by: khaweronline at gmail dot com
Summary: Echo dosn't print false
-Status: Open
+Status: Not a bug
Type: Bug
Package: *General Issues
Operating System: ALL OS
PHP Version: 5.6.13
Block user comment: N
Private report: N
New Comment:
var_dump((string) false);
prints string(0) "", as the string representation of false is actually an empty string.
Hence echoing it actually prints nothing.
Previous Comments:
------------------------------------------------------------------------
[2015-09-30 12:48:35] khaweronline at gmail dot com
Description:
------------
<?php
$a = 12;
$b = 15;
echo $a==$b; // This should output false or 0, but it didn't output anything
var_dump($a==$b); /* This will output Boolean false. This is just for reference that the value is
false */
// We can also assign it to a variable then echo and var_dump
$c = $a==$b;
echo $c; // This should output false or 0, but it didn't output anything
var_dump($c); /* This will output Boolean false. This is just for reference that the value is false
*/
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70608&edit=1