[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
?>