Pyh.conf’25: a new PHP conference for the Russian-speaking community

Voting

: four plus five?
(Example: nine)

The Note You're Voting On

mike at mbfisher dot com
10 years ago
[Editor note: this works because SplFileObject has the __toString() method which returns the file path]

Note that you can pass an SplFileInfo object as either argument:

<?php
# Assume a file 'foo' in the current directory

rename('foo', new SplFileInfo('bar'));

# foo is now bar!

rename(new SplFileInfo('bar'), 'foo');

# bar is now foo again
?>

<< Back to user notes page

To Top