note 114011 added to function.file-exists

From: Date: Mon, 30 Dec 2013 11:10:20 +0000
Subject: note 114011 added to function.file-exists
Groups: php.notes 
Request: Send a blank email to php-notes+get-198053@lists.php.net to get a copy of this message
I needed to measure performance for a project, so I did a simple test with one million file_exists() and is_file() checks. In one scenario, only seven of the files existed. In the second, all files existed. is_file() needed 3.0 for scenario one and 3.3 seconds for scenario two. file_exists() needed 2.8 and 2.9 seconds, respectively. The absolute numbers are off course system-dependant, but it clearly indicates that file_exists() is faster. ---- Server IP: 83.137.20.135 Probable Submitter: 2001:980:d8c5:1:d12:20ae:ad9e:9aeb ---- Manual Page -- http://php.net/manual/en/function.file-exists.php Edit -- https://master.php.net/note/edit/114011 Del: integrated -- https://master.php.net/note/delete/114011/integrated Del: useless -- https://master.php.net/note/delete/114011/useless Del: bad code -- https://master.php.net/note/delete/114011/bad+code Del: spam -- https://master.php.net/note/delete/114011/spam Del: non-english -- https://master.php.net/note/delete/114011/non-english Del: in docs -- https://master.php.net/note/delete/114011/in+docs Del: other reasons-- https://master.php.net/note/delete/114011 Reject -- https://master.php.net/note/reject/114011 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#198053) next »