|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #4807 !1 could return 0 instead of false
Submitted: 2000-06-04 18:01 UTC Modified: 2000-06-12 20:45 UTC
From: fuf at fuf dot sh dot cvut dot cz Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.0.0 Release OS: linux-2.2.14pre16 + some patches
Private report: No CVE-ID: None
 [2000-06-04 18:01 UTC] fuf at fuf dot sh dot cvut dot cz

  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/does 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.
		Michal Vitecek


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2000-06-12 20:45 UTC] zeev at cvs dot php dot net
It's indeed a sort of an incompatibility problem, but having made the introduction of the boolean type, !1 is definitely a boolean false and not a numeric 0...
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Nov 30 10:01:27 2023 UTC