php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #6400 division operator "/" does not perform integer division
Submitted: 2000-08-28 10:07 UTC Modified: 2000-08-28 14:04 UTC
From: tobias at langhammer dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.0.1pl2 OS: Linux version 2.4.0-test5
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: tobias at langhammer dot com
New email:
PHP Version: OS:

 

 [2000-08-28 10:07 UTC] tobias at langhammer dot com
In the following script the operator "/" does NOT perform an integer division as said in the documentation:

In chapter "Arithmetic Operators" the online documentation sais: "The division operator ("/") returns an integer value (the result of an integer division) if the two operands are integers (or strings that get converted to integers)."

Though the script

<?php echo "1 / 3 = ". 1/3 ?>

produces the following output:

1 / 3 = 0.33333333333333

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-28 14:04 UTC] torben@php.net
Fixed in cvs-thanks for noticing the thinko.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Mon Jun 15 07:00:01 2026 UTC