php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #50644 Error on description
Submitted: 2010-01-03 16:35 UTC Modified: 2010-01-03 19:22 UTC
From: kapouetangels at free dot fr Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 5.2.12 OS: Unix
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: kapouetangels at free dot fr
New email:
PHP Version: OS:

 

 [2010-01-03 16:35 UTC] kapouetangels at free dot fr
Description:
------------
Excuse my english, i'm french.

Function ob_get_contents :
In the description you say "Gets the contents of the output buffer without clearing it."

But in the example you can show that the buffer was cleaned.

You contradict yourself.

Sincerely, Delphin.

In french :
Dans la description vous dites "Retourne le contenu du tampon de sortie sans l'effacer."

Or dans l'example vous d?montrez que le buffer a ?t? n?toy?.
Vous vous contredisez.

Cordialement, Delphin.

Reproduce code:
---------------
---
From manual page: function.ob-get-contents#Exemples
---



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-03 19:22 UTC] degeberg@php.net
Thanks for your report.

The description is not contradictory to the example.

In the example, we start the output buffering and echo "Hello ". This means that "Hello " is now in the output buffer. We assign the current buffer to a variable called $out1 so it contains "Hello ". Now we echo "World" so the output buffer now contains "Hello World". We assign the current buffer to $out2.

Next we clear the buffer and end output buffering. Finally we var_dump $out1 and $out2 and to see what they contain.

It is correct that the buffer is cleaned in the example, but that is due to ob_end_clean(), not ob_get_contents().
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Oct 10 06:00:01 2026 UTC