|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-10-04 19:48 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 06:00:01 2025 UTC |
Problem find by paulo@teracom.com.br When run this script everything goes fine until we reach number 2147483647. In php 4.0.4, it turns the number negative. In latest CVS, it stop add value to the number. There is the script! To recriate the problem, put the 2147483640 value in stats.txt and refresh the page many times. The number do not pass 2147483648. Here's the script. <? $counter_file = "stats.txt"; $fp = fopen($counter_file, "r"); $counter = (int)fread($fp, 24); $close = fclose($fp); if (!isset($hits)) { $counter++; setcookie("hits","1"); } else { $counter++; setcookie("hits","$counter"); } $fp = fopen($counter_file , "w"); fwrite($fp, $counter); fclose($fp); print "Number: $counter"; ?>