<p>To grab the inode of a file in PHP, you can use this:</p>

<pre><code>$fs = stat($file);
echo $fs['ino'];
</code></pre>

<p>The problem with this is EVERYWHERE says it's slow and you should avoid it.  So the question becomes what's the fast(er) way to do it?</p>

[{'answer_id': 19716, 'author': 'mercutio', 'author_id': 1951, 'author_profile': 'https://Stackoverflow.com/users/1951', 'pm_score': 2, 'selected': True, 'text': '<p>You could use <a href="http://php.net/fileinode" rel="nofollow noreferrer"><code>fileinode()</code></a> but you should run benchmarks if you think it is slow.</p>\n'}, {'answer_id': 21644, 'author': 'Ryan Doherty', 'author_id': 956, 'author_profile': 'https://Stackoverflow.com/users/956', 'pm_score': 0, 'selected': False, 'text': '<p>I think you should benchmark and take a look at what you are doing to determine if stat() is the slowest part of your code. Stating 1 file on each request on a server that gets about 100 hits/day is not a problem. Stating every file could be a problem when you have to eek out a few more requests a second.</p>\n\n<p>You can avoid stating the same file repeatedly by caching the results via memcached, apc or some other in-memory caching system.</p>\n\n<p>Premature optimization is the root of all evil. - Donald Knuth</p>\n'}]
['https://Stackoverflow.com/questions/19708', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/497/']