php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #46334 Documentation enhancement request -- Type Juggling help page
Submitted: 2008-10-17 16:30 UTC Modified: 2008-11-04 17:02 UTC
From: hek at theeks dot net Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS: Irrelevant
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: hek at theeks dot net
New email:
PHP Version: OS:

 

 [2008-10-17 16:30 UTC] hek at theeks dot net
Description:
------------
On the "Type Juggling" help page at http://us.php.net/manual/en/language.types.type-juggling.php (or on some other related page) it would be useful to document the precedence (for lack of a better word) PHP follows when type juggling.

This entry currently explains that "if either operand is a float, then both operands are evaluated as floats, and the result will be a float" but could (and I think should) provide a hierarchy that indicates, for instance, "between an int and a boolean, int wins; between a float and an int, float wins; between a string and a float, string wins" and so on (and don't count on my example accurately capturing the true hierarchy, as I haven't actually done the tests to figure it out).

Thanks!


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-04 16:44 UTC] vrana@php.net
It's already documented at http://www.php.net/manual/en/language.operators.comparison.php (Comparison with Various Types).
 [2008-11-04 17:02 UTC] hek at theeks dot net
Thank you. That's very helpful, but unfortunately hard to find.  Perhaps a cross-reference is in order?
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 01:00:01 2026 UTC