$filePath = $ioObject->pathname; print $filePath; . . . #sets myObject attribute myPath to $filePath $myObject->myPath($filePath); Dump($myObject) > $aFile;