Phalcon v5.19.0 has been released! v6.0.0beta7 also released.
Bug fixes/changes
Several bugs have been fixed. The one to draw your attention to is the Phalcon\Filter\Validation\Validator\Callback validator. Previously the callback closure was bound to the validator, so $this inside it pointed at the validator rather than at the object where you wrote the closure. That binding is gone - $this now behaves the way PHP does natively. If you were calling $this->setTemplate() inside a callback, declare a second parameter and call $validator->setTemplate() instead. Check the documentation and/or changelog for the details.
Additionally, corrections to the Phalcon\Filter\Validation\Validator\StringLength validators to correctly include the upper/lower limits.
Fixed also some potential type errors in Html\Helper\Input and some not so obvious bugs relating to the Image namespace. Those were primarily undetected because of the particular edge cases that were never tested or tested against incorrect data. We managed to get proper samples of images with specific alpha/frames/animation etc. and with that testing harness we were able to fix the output of specific methods. More in the changelog below.
Worth calling out one of those: watermark() silently did nothing for any opacity below 100, so if your watermarks never showed up, this release fixes it. Animated GIFs also keep all their frames now through reflection(), render() and save().
Additions
Phalcon\DataMapper now is events aware. For those that use the component, you can now attach the events manager and start listening to the events fired. Useful for metrics, additional operations, flows etc.
Alignment and tooling
The final alignment task between cphalcon and phalcon is underway. Every namespace, every file is checked against each other to ensure that they are the same. We even carry the mixed types in certain properties, because v5 has that, even though for v6 and the PHP land one could for argument’s sake use array|string. The goal is to have those two 100% aligned. Our new tool Quill is helping a lot so that task becomes a bit easier. More on Quill on an upcoming blog post.
The remaining task is to get PHPStan to max. Granted, this can only happen in v6, since it is a PHP tool, but we are running it on max for each namespace with two goals:
- identify potential misalignments with v5
- offer proper shapes to the community on what components expect and produce
For the first one, this exercise alone identified several bugs (example the Image bugs listed in the changelog) which were fixed. For the shapes, we introduced *Types interfaces that live in the Contracts top namespace. Developers can import those shapes in their applications if they need to.
Thanks
As always, thank you to everyone who reported an issue, opened a pull request, or tested a build before it shipped.
Changelog
5.19.0 (2026-08-19)
Tools
- Zephir 1.2.0 (a09648c)
Changed
- Changed
Phalcon\Filter\Validation\Validator\Callbackto stop binding the callback closure to the validator; to set the message from inside the callback (#17255), declare a second parameter and call$validator->setTemplate()instead of$this->setTemplate()#17499 [doc] - Changed
Phalcon\Filter\Validation\Validator\StringLength,Phalcon\Filter\Validation\Validator\StringLength\MinandPhalcon\Filter\Validation\Validator\StringLength\Maxto treatminandmaxas inclusive when theincludedoption is not set, matching the class documentation and the behavior before 5.7.0; setincludedtofalsefor exclusive boundaries #17503 [doc]
Added
- Added
includedMinimumandincludedMaximumas aliases of theincludedoption inPhalcon\Filter\Validation\Validator\StringLength\MinandPhalcon\Filter\Validation\Validator\StringLength\Max, so the option names of theStringLengthcontainer also work on the two validators directly.includedhas precedence if you set both #17503 [doc] - Added lifecycle events to the DataMapper connections, fired through
Phalcon\Events\Managerand named on the newPhalcon\DataMapper\Pdo\Eventsclass:dm:beforeConnect/dm:afterConnect,dm:beforeDisconnect/dm:afterDisconnect,dm:beforePerform/dm:afterPerform,dm:beforeExec/dm:afterExec,dm:beforeQuery/dm:afterQuery,dm:beforeBeginTransaction/dm:afterBeginTransaction,dm:beforeCommit/dm:afterCommit,dm:beforeRollBack/dm:afterRollBackanddm:connectionLost.prepare()has no events of its own becauseperform()calls it, which would report one operation twice. The connect, disconnect and connectionLost events report a change of the connection state and fire whichever method causes it, so an automatic reconnect reports the lost connection and the new one.Phalcon\DataMapper\Pdo\Connection\Decorateddoes not fire the connect and disconnect events because it never connects and cannot disconnect. #17501 [doc] - Added
getEventsManager()andsetEventsManager()toPhalcon\DataMapper\Pdo\Connection\AbstractConnection, and therefore toPhalcon\DataMapper\Pdo\ConnectionandPhalcon\DataMapper\Pdo\Connection\Decorated, and toPhalcon\DataMapper\Pdo\ConnectionLocator, which gives its events manager to every connection it returns, including the ones it builds on demand. The two classes now carry thePhalcon\Contracts\Events\EventsAwarecontract.Phalcon\DataMapper\Pdo\Connection\ConnectionInterfaceis unchanged, so classes that implement it directly keep working #17501 [doc] - Added
Phalcon\DataMapper\Pdo\Exception\OperationCancelled, thrown when a listener cancels one of thebefore*events. The operation does not run. To cancel, a listener must call$event->stop()and also returnfalse:stop()alone returns the value of the listener, which the connection cannot tell apart from “no listeners”, andfalsealone is replaced by any later listener that returns a value while the events manager is not instopOnFalsemode. Theafter*events are not cancellable #17501 [doc]
Fixed
- Fixed
Phalcon\Filter\Validation\Validator\Callbackrebinding$thisin callback closures; the validator is now passed as a second argument to closures that declare one #17499 [doc] - Fixed
Phalcon\Filter\Validation\Validator\StringLength\MinandPhalcon\Filter\Validation\Validator\StringLength\Maxrejecting a string with a length exactly equal tominormaxwhen theincludedoption was not set, a regression introduced in 5.7.0 #17503 [doc] - Fixed
Phalcon\Filter\Validation\Validator\StringLengthgiving theincludedMinimum/includedMaximumandmessageMinimum/messageMaximumoption of one boundary to the validator of the other boundary #17503 [doc] - Fixed
Phalcon\Html\Helper\Input\Generic,Phalcon\Html\Helper\Input\CheckboxandPhalcon\Html\Helper\Input\Radiothrowing an error when you build them directly without aPhalcon\Html\Helper\Doctype. #17507 [doc] - Fixed
Phalcon\Image\Adapter\Imagick::processReflection()applying the reflection to the first frame only of a multi-frame image, because the first two loops changed thereflectionclone but moved the frame cursor ofthis->image#17510 [doc] - Fixed
Phalcon\Image\Adapter\Imagick::background(),reflection(),text()andwatermark()discarding any opacity below 100, andsharpen()rounding its amount down, because the division by 100 was stored back in the integer parameter;watermark()left the image unchanged for every opacity except 100 #17510 [doc] - Fixed
Phalcon\Image\Adapter\Imagicknever coalescing the frames of a GIF, because the constructor comparedgetImageType(), an ImagickIMGTYPE_*value, againstIMAGETYPE_GIF; the width and the height of an animated GIF now describe the canvas instead of whichever sub frame the cursor was on #17510 [doc] - Fixed
Phalcon\Image\Adapter\Imagick::render()returning the current frame alone for a GIF, andsave()failing withno encode delegate for this image formatafter an operation that rebuilds the image; both now mark every frame with the format, whichsetImageFormat()applies to the current frame only #17510 [doc]
Removed
Upgrade
Developers can upgrade using PIE
pie install phalcon/cphalcon-5.19.0
To compile from source, follow our installation document
Chat - Q&A
Support
Social Media
Videos
<3 Phalcon Team