php.net |  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
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: fuf at fuf dot sh dot cvut dot cz
New email:
PHP Version: OS:

 

 [2000-06-04 18:01 UTC] fuf at fuf dot sh dot cvut dot cz
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/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.
  
	thanks,
		Michal Vitecek

Patches

Pull Requests

History

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-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 14 01:01:28 2024 UTC