Doc #75203 [Ver->Csd]: FILE_USE_INCLUDE_PATH: INT instead BOOL.
| From: | cmb@php.net | Date: | Tue, 19 Sep 2017 15:05:12 +0000 |
| Subject: | Doc #75203 [Ver->Csd]: FILE_USE_INCLUDE_PATH: INT instead BOOL. | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-14980@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=75203&edit=1
ID: 75203
Updated by: cmb@php.net
Reported by: saymongcsw at gmail dot com
Summary: FILE_USE_INCLUDE_PATH: INT instead BOOL.
-Status: Verified
+Status: Closed
Type: Documentation Problem
Package: Filesystem function related
Operating System: any
PHP Version: 7.1.9
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation better.
Previous Comments:
------------------------------------------------------------------------
[2017-09-19 15:04:44] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=343110
Log: Fix #75203: FILE_USE_INCLUDE_PATH: INT instead BOOL
------------------------------------------------------------------------
[2017-09-19 14:32:25] cmb@php.net
Actually, we can't change FILE_USE_INCLUDE_PATH to bool, because it is an
accepted flag for the $flags parameter of file_put_contents() (which is an int).
Changing the $use_include_path parameter of file_get_contents() to int is also
not an option. Therefore the documentation will have to be fixed.
------------------------------------------------------------------------
[2017-09-18 18:56:42] saymongcsw at gmail dot com
https://3v4l.org/2Uvu1 another example.
------------------------------------------------------------------------
[2017-09-13 23:09:53] cmb@php.net
To fix this FILE_USE_INCLUDE_PATH would have to be registered via
REGISTER_BOOL_CONSTANT[1]. I'm not sure about the potential BC
break, though.
[1] <https://github.com/php/php-src/blob/PHP-7.0.23/ext/standard/file.c#L302>
------------------------------------------------------------------------
[2017-09-13 17:11:19] saymongcsw at gmail dot com
Description:
------------
FILE_USE_INCLUDE_PATH returns 1 instead true. https://3v4l.org/UqBVt
what causes error with strict_types=1 in file_get_contents().
Test script:
---------------
<?php
declare(strict_types = 1);
file_get_contents('example.txt', FILE_USE_INCLUDE_PATH);
Expected result:
----------------
load contents successfully.
Actual result:
--------------
file_get_contents() expects parameter 2 to be boolean, integer given
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75203&edit=1