PHP 4.0 Bug #4805: !1 could return 0 instead of false

From: Date: Sun, 04 Jun 2000 15:30:37 +0000
Subject: PHP 4.0 Bug #4805: !1 could return 0 instead of false
Groups: php.dev 
Request: Send a blank email to php-dev+get-20186@lists.php.net to get a copy of this message
From: fuf@fuf.sh.cvut.cz Operating system: linux-2.2.14pre16 + some patches PHP version: 4.0.0 Release PHP Bug Type: Misbehaving function Bug description: !1 could return 0 instead of false hello, !1 returns false now in php4.0 so it's not outputted in echo (echo "!1: " . (!1) . "\n"; ) whereas in php3.x !1 returned 0 and was displayed. i know this is not a bug, but it may render many scripts (including the ones i'm working on (~50.000 lines)) misbehave in certain conditions and definitely is a compatibility problem. _checking_ and changing !<some_expression> to (int)!<some_expression> would take *LOTS* of time, so IMO this behaviour should be changed or at least be configurable via some option. or the way echo outputs boolean could be changed. please, don't make php programmers go berserk :) thanks, Michal Vitecek

« previous php.dev (#20186) next »