Was the use_include_path parameter replaced by the flags parameter?

Asked

Viewed 167 times

2

I always use the English documentation of PHP, because it seems to me that it is always more up to date, but when accessing 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 only available from PHP 6. If you are using a previous version and want to search for the filename file in include_path, this parameter must be TRUE. From PHP 6, you must 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 parameter use_include_path has been replaced by the parameter flags.

But in the English documentation it is 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 parameter $flags is since version 6 and in the English documentation the parameter $flags is used since version 5.

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

1 answer

1


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

Before the announcement of PHP7 (Who will launch PHP7 without PHP6? - I will explain this throughout the response. ) planned for September 2015, there was much speculation about PHP6, even a considerable number of books released that addressed PHP6 even though it did not yet exist, these books explained about many things that have been implemented from PHP5.4+ or situations that don’t really exist.

The PHP documentation is "collaborative" and each language is a "Fork" page of the English version, I believe that due to these books/information (which addressed the supposed PHP6) have "fooled" the developers of the documentation.

PHP6 exists (existed)?

There was no PHP6, there were many confusions on the subject, because whenever some information was published about novelties that would be released in PHP6 many took advantage of such information (or made mistakes) and replicated such information without the 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 "defined yet".

The use_include_path parameter has been replaced by the flags parameter?

As the example of documentation in English:

<?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 these links confirm:

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

Solving problems with documentation

Note that it is possible to report bugs in the documentation or edit:

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.