nette/utils
🛠 Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.
v4.1.5
455M downloads/mo
#85 most downloaded on composer
nette/utils
What this package is like to depend on
Last release 1 months ago
17 Jul 2026
Release timing varies
gaps range from 3 weeks to 8 months
Rarely documented
notes for 9 of 77 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
77 releases · first in 2014
7 releases in the last 12 months
see the full history below
Release timeline
77 releases · May 2014 to Jul 2026Releases
latest 60 of 77-
v4.1.517 Jul 2026Release notes
Open source →This release adds an immutable date/time class, makes file writes safer, background processes possible, and Finder masks smarter. Plus a couple of bug fixes worth picking up.
✨ New Features
- DateTimeImmutable – a new immutable counterpart to
Nette\Utils\DateTime. It extends PHP's\DateTimeImmutablewith strict validation (invalid dates and times throw instead of being silently rolled over), convenient factoriesfrom()andfromParts(), DST-safe relative modifications, and JSON serialization. - FileSystem::writeAtomic() – writes a file atomically via a temporary file and rename, so a concurrent reader never sees it partially written or truncated. Ideal for caches and generated configs.
- Process::detach() – lets a process keep running in the background after the
Processobject is destroyed, instead of being killed by the destructor. Output must go to a file or be discarded, since nobody reads the pipes after detaching. - Process – on Windows with PHP 8.5, captured output now flows through real pipes instead of temporary files, thanks to the fixed
stream_select(). - Html::fragment() and add() – create a nameless element pre-filled with children, or append children to an existing element. Unlike
addHtml(), plain strings are escaped by default and nulls are skipped. - Html::text() and Html::html() – new static factories replacing
fromText()andfromHtml(), which are now deprecated. - Finder – the mask now fully drives recursion:
**/footogether within()searches recursively, and the**short form expands like in zsh, sotest/**meanstest/**/*and**.cmeans**/*.c(previously such masks silently degraded to a single*). - Finder – a trailing slash in a
find()mask matches directories only:find('temp/'). - Finder::exclude() – now uses the same mask grammar as
find():**.txtworks,./anchors to the search root, and a trailing/,/*or/**controls whether the directory itself, its contents, or both are excluded. - Finder – paths are no longer normalized to forward slashes; they stay in their native form, which also fixes corruption of backslashes in POSIX file names. Note: on Windows, returned paths may now contain backslashes where they used to be unified.
🐛 Bug Fixes
- ArrayList::prepend() – no longer misbehaves on an empty list.
- Validators::isUrl() – now rejects malformed IPv4 addresses with octets above 255, so nonsense like
http://999.1.1.1no longer passes as a valid URL. - Strings::compare() – tolerates invalid UTF-8 instead of failing when the Normalizer gives up.
- Strings::length() – the fallback used when neither
mbstringnoriconvis available no longer relies on the deprecatedutf8_decode(), so it stays quiet on PHP 8.2+. - Finder::exclude() –
exclude('subdir/')silently excluded nothing due to a greedy regex; the trailing/,/*and/**variants now work as documented.
- DateTimeImmutable – a new immutable counterpart to
-
v4.1.411 May 2026Release notes
Open source →- Process – a new class for starting and controlling external processes: read their output, feed them input, pipe one process into another, wait for completion, terminate, and check exit codes.
Process::runExecutable()passes arguments as an array so there's zero shell involvement and no risk of shell injection, whileProcess::runCommand()is there when you really do want the shell. Comes with timeouts, incremental output consumption (consumeStdOutput()/consumeStdError()), and works on Windows too. - FileSystem::isValidFilename() – quickly check whether a string is a safe, cross-platform filename: it rejects path separators, control and reserved characters, trailing dots or spaces, and Windows device names like
CONorLPT1. - Image::fromFile() and Image::fromString() now accept an optional
$warningsparameter – pass it in and any GD warnings are handed back to you as a string instead of being emitted as a PHP warning, so you can log or display them on your own terms.
- Process – a new class for starting and controlling external processes: read their output, feed them input, pipe one process into another, wait for completion, terminate, and check exit codes.
-
v4.1.313 Feb 2026Release notes
Open source →A maintenance release focused on code quality: stricter types, better PHPDoc annotations, and PHPStan now runs as a mandatory CI check. No breaking changes.
-
v4.1.122 Dec 2025Release notes
Open source → -
v4.1.001 Dec 2025Release notes
Open source →- requires PHP 8.2
- DateTime: strict behavior (BC break)
- Strings::webalize() requires INTL extension
- StaticClass: is not overriding __callStatic()
-
v4.0.1001 Dec 2025Release notes
Open source →- added
Type::with() - added
Type::fromValue() - added
Helpers::splitClassName() - added
Iterables::repeatable() - Finder:
is_file()does not work with symlinks under Windows
- added
-
v4.0.931 Oct 2025Nothing published for this version
-
v4.0.806 Aug 2025 -
v4.0.703 Jun 2025Release notes
Open source →- DateTime: constructor and
modify()correctly handle the relative time even if the daylight saving time is changed - DateTime: added static method
relativeToSeconds()for converting relative time string to seconds - DateTime: triggers a warning when time overflow occurs
- DateTime: constructor and
-
v4.0.630 Mar 2025Release notes
Open source →- Image: catches all errors during saving
- added Helpers::IsWindows
- added ShouldNotHappenException
- added
FileSystem::resolvePath()#308 - tests: improved descriptions
- exception: use natural explanatory style
-
v4.0.507 Aug 2024Nothing published for this version
-
v4.0.417 Jan 2024Nothing published for this version
-
v4.0.329 Oct 2023Nothing published for this version
-
v4.0.219 Sep 2023Nothing published for this version
-
v4.0.130 Jul 2023Nothing published for this version
-
v4.0.002 Feb 2023Nothing published for this version
-
v3.2.1030 Jul 2023Nothing published for this version
-
v3.2.918 Jan 2023Nothing published for this version
-
v3.2.812 Sep 2022Nothing published for this version
-
v3.2.724 Jan 2022Nothing published for this version
-
v3.2.624 Nov 2021Nothing published for this version
-
v3.2.520 Sep 2021Nothing published for this version
-
v3.2.316 Aug 2021Nothing published for this version
-
v3.2.203 Mar 2021Nothing published for this version
-
v3.2.111 Jan 2021Nothing published for this version
-
v3.2.025 Nov 2020Nothing published for this version
-
v3.1.620 Sep 2021Nothing published for this version
-
v3.1.425 Nov 2020Nothing published for this version
-
v3.1.307 Aug 2020Nothing published for this version
-
v3.1.227 May 2020Nothing published for this version
-
v3.1.109 Feb 2020Nothing published for this version
-
v3.1.003 Jan 2020Nothing published for this version
-
v3.0.405 Nov 2020Nothing published for this version
-
v3.0.327 Dec 2019Nothing published for this version
-
v3.0.221 Oct 2019Nothing published for this version
-
v3.0.122 Mar 2019Nothing published for this version
-
v3.0.005 Feb 2019Nothing published for this version
-
v2.5.713 Dec 2020Nothing published for this version
-
v2.5.626 Nov 2020Nothing published for this version
-
v2.5.505 Nov 2020Nothing published for this version
-
v2.5.419 Nov 2019Nothing published for this version
-
v2.5.318 Sep 2018Nothing published for this version
-
v2.5.202 May 2018Nothing published for this version
-
v2.5.119 Feb 2018Nothing published for this version
-
v2.5.017 Feb 2018Nothing published for this version
-
v2.4.1018 Sep 2018Nothing published for this version
-
v2.4.906 Feb 2018Nothing published for this version
-
v2.4.820 Aug 2017Nothing published for this version
-
v2.4.711 Jul 2017Nothing published for this version
-
v2.4.626 Apr 2017Nothing published for this version
-
v2.4.529 Mar 2017Nothing published for this version
-
v2.4.416 Jan 2017Nothing published for this version
-
v2.4.309 Jan 2017Nothing published for this version
-
v2.4.219 Dec 2016Nothing published for this version
-
v2.4.128 Sep 2016Nothing published for this version
-
v2.4.017 Jun 2016Nothing published for this version
-
v2.3.1112 Dec 2016Nothing published for this version
-
v2.3.1017 Jun 2016Nothing published for this version
-
v2.3.921 Apr 2016Nothing published for this version
-
v2.3.818 Mar 2016Nothing published for this version