You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feature #33003 [Filesystem] Add $suffix argument to tempnam() (jdufresne)
This PR was submitted for the 4.4 branch but it was merged into the 5.1-dev branch instead (closes#33003).
Discussion
----------
[Filesystem] Add $suffix argument to tempnam()
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #33002
| License | MIT
| Doc PR | symfony/symfony-docs#12108
**Description**
The `tempnam()` interface was previously:
```php
tempnam($dir, $prefix)
```
This adds a third argument, `$suffix`, that is appended to the filename after the random component. This defaults to `''` for backwards compatibility. This is quite useful when the temporary file is consumed for a specific purpose that expects a suffix.
**Example**
```php
$filesystem->tempnam('/tmp', 'prefix_', '.png');
```
Would create a file like: `/tmp/prefix_abcd1234.png`.
Commits
-------
ef12069 [Filesystem] Add $suffix argument to tempnam()
0 commit comments