php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23910 opening a URL with fopen gives different results than in 4.3.1
Submitted: 2003-05-30 16:24 UTC Modified: 2003-05-30 16:57 UTC
From: nmcfaul at mcfaulgolf dot com Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 4.3.2 OS: Linux 2.4.20
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: nmcfaul at mcfaulgolf dot com
New email:
PHP Version: OS:

 

 [2003-05-30 16:24 UTC] nmcfaul at mcfaulgolf dot com
I'm having trouble figuring out why when I use fopen to open a URL in 4.3.2 I get different output than in 4.3.1.

I'm using the following to get sport scores from sportline.com, i also put in some troubleshooting code to help me determine the problem.

$url = "http://www.sportsline.com/mlb/box-scoreboards";

$fp=fopen($url,"rb") or die ("<p>Could not Open Sportsline.com</p>");
$handle = fopen("/opt/web/sportsline.txt","a");

$file=fread($fp,600000);
$new=substr($file,0);

fwrite($handle,$new);
fclose($handle);
fclose($fp);

When I run the above script in 4.3.2 I get a filesize of 2434 bytes, when I run the exact same code in 4.3.1, I get a filesize of 10733 bytes.

I've used the exact same configure script parameters for both PHP builds, and the same apache version (2.0.46)

Any assistance would be appreciated!

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-30 16:57 UTC] wez@php.net
4.3.0 and 4.3.1 were actually broken in allowing your script to work in the way that it did.
4.3.2 re-introduces the correct behaviour from 4.2.x days and earlier.
We updated the online manual today to reflect this; please read this:
http://www.php.net/manual/en/function.fread.php

This is expected behaviour, so I'm marking this report as bogus (as it is not a bug).
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Jul 04 09:01:34 2025 UTC