Is the use_include_path parameter replaced with the flags parameter?

2

I usually use the English documentation of PHP, as it seems to me that it is always updated, but when I access the documentation of file_get_contents in Portuguese, I noticed the following messages:

string file_get_contents ( string $filename [, int $flags [, resource $context [, int $offset [, int $maxlen ]]]] )

flags :

  

Warning

     

For all versions prior to PHP 6, this parameter is called use_include_path and is a bool. The flags parameter is available only from PHP 6. If you are using an earlier version and want to fetch the filename file from the include_path, this parameter should be TRUE. From PHP 6, you should use the FILE_USE_INCLUDE_PATH flag.

Changelog

  • 5.0.0 Added context support.
  • 5.1.0 Added parameters offset and maxlen .
  • 6.0.0 The use_include_path parameter was replaced with the flags parameter.

But in the English documentation it looks like this:

  

Note:

     

As of PHP 5 the FILE_USE_INCLUDE_PATH constant can be used to trigger include path search.

That is, it seems to me that the information in Portuguese says that the $flags parameter is from version 6 and in English documentation the $flags parameter has been used since version 5.

Is this an error in the documentation in Portuguese? I used FILE_USE_INCLUDE_PATH and it worked perfectly with PHP5, this makes me think that documentation in Portuguese is not reliable.

    
asked by anonymous 27.05.2015 / 21:00

1 answer

1

I'm not sure about this, but I think it's something wrong even in the documentation

Before the announcement of PHP7 (Will PHP7 be released without PHP6?) - I'll explain this throughout the answer.) planned for September 2015, there was a lot of speculation about PHP6, even a considerable number of released books that addressed PHP6 even though it did not exist yet, these books explained about many things that were implemented from PHP5.4+ or situations that do not really exist.

The PHP documentation is "collaborative" and each language is a "fork" page of the English version, I believe that because of these books / information (which dealt with the alleged PHP6) they "misled" the documentation collaborators.

Does PHP6 exist (existed)?

No PHP6 did not exist, there were many confusions on the subject, because whenever information was released to the public about news that would be released in PHP6 many took advantage of such information (or was mistaken) and leave replicating such information without certainty of the future.

We can say that part of what would be PHP6 is in PHP5.4 + (or PHP5.6) and the other part has not been "set yet."

The use_include_path parameter has been replaced by the flags parameter?

According to the English documentation example:

<?php
// Example #2 Searching within the include_path
// <= PHP 5
$file = file_get_contents('./people.txt', true);
// > PHP 5
$file = file_get_contents('./people.txt', FILE_USE_INCLUDE_PATH);
?>

The change occurs from PHP4 to PHP5 and this links confirms:

  

FILE_USE_INCLUDE_PATH (integer) Search for filename in include_path (since PHP 5).

Solving documentation problems

Note that you can report bugs in the documentation or edit:

We can assume with this that it was a badly done edition due to wrong information and that it is possible to edit and correct it.

    
07.06.2015 / 23:52