note 118596 added to function.count

From: Date: Tue, 05 Jan 2016 21:33:10 +0000
Subject: note 118596 added to function.count
Groups: php.notes 
Request: Send a blank email to php-notes+get-204599@lists.php.net to get a copy of this message
I agree with jingsoft at 126 dot com comments about a possible PHP bug. In PHP 5.1.6 (cli) (built: Nov 6 2014 12:25:07) on Centos 5.11, I create arrays with, for example, $anum = array; I add to the array ... $anum[] = $variable; Then, after storing 7 items (array items 0-6) I do:- $count = count($anum); and get 8. I can manually count the array items when storing them, so the count's wrong value can be avoided - it's just annoying because of the wasted time. ---- Server IP: 72.52.91.14 Probable Submitter: 81.5.131.221 ---- Manual Page -- http://php.net/manual/en/function.count.php Edit -- https://master.php.net/note/edit/118596 Del: integrated -- https://master.php.net/note/delete/118596/integrated Del: useless -- https://master.php.net/note/delete/118596/useless Del: bad code -- https://master.php.net/note/delete/118596/bad+code Del: spam -- https://master.php.net/note/delete/118596/spam Del: non-english -- https://master.php.net/note/delete/118596/non-english Del: in docs -- https://master.php.net/note/delete/118596/in+docs Del: other reasons-- https://master.php.net/note/delete/118596 Reject -- https://master.php.net/note/reject/118596 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#204599) next »