Bug #61336 [Opn->Wfx]: file_get_contents() no longer returns false on 4xx responses

From: Date: Fri, 06 May 2016 14:06:13 +0000
Subject: Bug #61336 [Opn->Wfx]: file_get_contents() no longer returns false on 4xx responses
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-200922@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=61336&edit=1

 ID:                 61336
 Updated by:         nikic@php.net
 Reported by:        ramsey@php.net
 Summary:            file_get_contents() no longer returns false on 4xx
                     responses
-Status:             Open
+Status:             Wont fix
 Type:               Bug
 Package:            Filesystem function related
 Operating System:   CentOS 6.2
 PHP Version:        5.4.0
 Block user comment: N
 Private report:     N

 New Comment:

Closing this as "Won't Fix" as --with-curlwrappers has been removed inf PHP 5.5, so
this is no longer relevant.


Previous Comments:
------------------------------------------------------------------------
[2013-03-30 13:29:39] laruence@php.net

confirm, when compile with curlwrappers, 
then I am not sure whether this is a bug, since curlwrappers has it's own 
implementation..

------------------------------------------------------------------------
[2013-03-29 20:19:13] stasismedia at gmail dot com

FYI, I experienced this issue when PHP was compiled with --with-curlwrappers

------------------------------------------------------------------------
[2013-03-04 15:04:51] php at maisqi dot com

Just noted that I gave a wrong URI to the script; sorry, here is the right one:

http://maisqi.com/outros/bugs/php/61336

------------------------------------------------------------------------
[2013-03-04 15:01:49] php at maisqi dot com

vestigalorgan, you are right: it should return false in all three cases. Thanks for correcting.

------------------------------------------------------------------------
[2013-03-02 01:50:21] vestigalorgan at gmail dot com

I've run the test case that maisqi provided, and here are my results:


1. Using file_file_get_contents() on an non-existing resource on a existing domain:
    The result: boolean
    $http_response_header: array

2. Using file_file_get_contents() on a non-existing domain, with follow_location => 0 on the
context:
    The result: boolean
    $http_response_header: NULL

3. Using file_file_get_contents() on a non-existing domain, __without__ follow_location => 0 on
the context:
    The result: boolean
    $http_response_header: NULL

This is on Ubuntu 12.04 LTS 64-bit with Apache 2.2.22 and PHP 5.3.10-1ubuntu3.5 with the
Suhosin-Patch. Everything appears to be working fine there.

Shouldn't the output of the results be a boolean false, not NULL, maisqi?

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=61336


--
Edit this bug report at https://bugs.php.net/bug.php?id=61336&edit=1


Thread (20 messages)

« previous php.bugs (#200922) next »