5.24.0 (2026-11-28)
Tools
- Zephir 1.11.0
Changed
- A callback that cannot be called throws
TypeErrorinstead of a warning andnull. #17766 - Faster ACL build in
Phalcon\Acl\Adapter\Memory. #17701 - Faster HTML output of the
Phalcon\Flashmessages with no icon classes. #17712 - Faster HTML output of the
Phalcon\Flashmessages. #17704 - Faster
Phalcon\Acl\Adapter\Memory::isAllowed(). #17711 - Faster
Phalcon\Cache\Cache, thePhalcon\Storageadapters andPhalcon\Acl\Adapter\Memory::isAllowed()when no events manager is set. #17703 - Faster
Phalcon\Config\Config::path(). #17714 - Faster
Phalcon\Loggercalls with no excluded adapters. #17713 - Faster
Phalcon\Mvc\Microrequests with the default router service. #17715 - Faster base64url decode in the JWT parser and
Phalcon\Encryption\Crypt::decryptBase64(). #17705 - Faster construction of
Phalcon\Config\Configand its adapters when the config has no type. #17702 - Faster construction of the validators in
Phalcon\Filter\Validation. #17697 - Faster item storage, lookup, removal and JSON serialization in
Phalcon\Support\Collection. #17683 - Faster route index build in
Phalcon\Mvc\Routerfor routes with no host name. #17693 - Faster service registration in
Phalcon\Factory\AbstractFactoryand the factories that extend it. #17696 Phalcon\Mvc\Model\Query::clean()now also empties the cache of parsed PHQL statements, the same asPhalcon\Mvc\Model\Manager::__destruct(). #800
Added
- Benchmark subjects for Acl, Cache, Config, Flash, Forms, Jwt, Logger, Security, Session and Validation in
tests/benchmarks. #17695 Phalcon\Support\Settingssupport fororm.cache_levelandorm.unique_cache_id. #800
Fixed
- PHP 8.4+ builds from
build/phalcon(PECL, PIE,build/install) calling the userlandjson_encode()andjson_decode(), becauseconfig.m4checked forHAVE_JSON, which PHP 8.4 removed. #16523 - PHP 8.6 builds failing because PHP 8.6 removed
zval_dtor(): the PHQL parser, the Volt parser andPhalcon\Mvc\Urlnow usezval_ptr_dtor_nogc(). #17766 - PHP 8.6 deprecation for session handlers without
create_sid():Phalcon\Session\Adapter\AbstractAdapterandPhalcon\Session\Adapter\Noopnow implementSessionIdInterfaceandcreate_sid(). #17687 - PHP 8.6 deprecation of
doubleval():Phalcon\Encryption\Security\Uuid\Version1,Phalcon\Encryption\Security\Uuid\Version6andPhalcon\Mvc\Modelnow usefloatval(). #17687 - PHP 8.6 deprecation of
spl_object_hash():Phalcon\Dispatcher\AbstractDispatcherandPhalcon\Html\Link\AbstractLinkProvidernow usespl_object_id(); the keys returned bygetLinks()are now integers. #17687 Phalcon\Acl\Adapter\Memory::addRole()andaddComponent()accepting a customRoleInterfaceorComponentInterfacename with the!delimiter, which let one role, component and access tuple share the access key of another. #17800Phalcon\Acl\Adapter\Memory::isAllowed()granting the access of a rule whose callback cannot be called, for example a function that does not exist or a private method. #17800Phalcon\Acl\Adapter\Memory::isAllowed()not firingacl:afterCheckAccessfor a role that does not exist. #17800Phalcon\Acl\Adapter\Memory::isAllowed()throwingReflectionExceptionfor a rule parameter whose class does not exist. #17800Phalcon\Acl\Adapter\Storagegiving an "Array to string conversion" warning for a snapshot version that is not an integer or a string. #17800Phalcon\Annotations\Adapter\Stream::read()returning the content of a cache file that does not hold aReflectionobject. #17773Phalcon\Annotations\Adapter\Stream::write()writing the cache files with no PHP opening tag, so that a web request to a file in a folder that the web server can reach showed the serialized annotations. #17812Phalcon\Annotations\Adapter\Streamusing one cache file for the anonymous classes of a file whose path has no_, so that a class got the annotations of another class. #17810Phalcon\Assets\Asset::getRealTargetPath()accepting a symbolic link to a file that does not exist, which letPhalcon\Assets\Managerwrite an asset outside the target folder. #17802Phalcon\Auth\Adapter\Model::retrieveByCredentials()accepting a credential key with a newline at the end, instead of throwingInvalidCredentialKey. #17804Phalcon\Auth\Internal\ContainerResolver::resolveFresh()returning the same object for a non-sharedPhalcon\Di\Diservice whose definition is a built object, so that two activations of an access gate could share one instance. #17806Phalcon\Container\Definition\Processor\ObjectProcessor::process()setting a factory closure with no parameters, although the factory is called with the container. #17777Phalcon\Contracts\Db\Adapter\Adapter::fetchColumn()andPhalcon\Db\Adapter\AbstractAdapter::fetchColumn()declaringstring|boolas the return type instead ofmixed. #17755Phalcon\DataMapper\Pdo\Connection\AbstractConnection::__call()giving a warning and aTypeErrorinstead ofUnknownDriverMethodfor a method name that is not a string. #17796Phalcon\Db\Adapter\Pdo\Postgresql::describeColumns()reportingmediumblobcolumns asColumn::TYPE_TEXT. #17724Phalcon\Db\Adapter\Pdo\Postgresql::describeReferences()returning wrong column pairs for composite foreign keys. #17680Phalcon\Db\Adapter\Pdo\Sqlite::describeColumns()reportingtinyint(1)columns asColumn::TYPE_INTEGER. #17724Phalcon\Db\Adapter\Pdo\Sqlite::describeColumns()reporting blob columns asColumn::TYPE_VARCHAR. #17724Phalcon\Db\Adapter\Pdo\Sqlite::describeColumns()usingColumn::TYPE_DECIMALas the bind type offloatcolumns, which stored their values as blobs. #17724Phalcon\Db\Adapter\Pdo\Sqlite::describeReferences()givingnullreferenced columns for a foreign key with no referenced columns, which references the primary key of the referenced table. #17815Phalcon\Db\Adapter\Pdo\Sqlite::describeReferences()giving one reference for each column of a composite foreign key. #17814Phalcon\Db\Dialect::checkColumnType()declaringstringas the return type instead ofint. #17796Phalcon\Db\Dialect::escapeSchema()not escaping the quote character in the schema name, which all the dialects use for the schema of a table, for example inPhalcon\Db\Dialect\Postgresql::truncateTable(). #17808Phalcon\Db\Dialect\Mysql::listTables()returning MariaDB sequences andPhalcon\Db\Dialect\Postgresql::listTables()returning partitions. #17769Phalcon\Db\Dialect\Mysql::truncateTable()andPhalcon\Db\Dialect\Sqlite::truncateTable()not escaping the quote character in the table and schema names. #17808Phalcon\Db\Dialect\Postgresql::describeReferences()giving the name of the database as the referenced schema, instead of the schema of the referenced table. #17816Phalcon\Encryption\Security::hash()passing a numeric stringcostoption on as a string, which gave an invalid Blowfish salt for a fractional value. #17779Phalcon\Encryption\Security::hash()using the cost4instead of the work factor when thecostoption is empty. #17764Phalcon\Forms\Form::getValue()returning the tag factory for the nametagFactory. #17727Phalcon\Html\Escaper\CssEscaperandPhalcon\Html\Escaper\JsEscaperdeclaringstringas the return type of their private escape methods, which returnfalsefor the code point U+0000. #17783Phalcon\Http\Request\Bag\AbstractBag::normalizeKey()declaringstringas the return type instead ofint|string. #17771Phalcon\Image\Adapter\Imagick::processSave()returningnullinstead oftruefor a GIF file. #17788Phalcon\Mvc\Model::doLowInsert()not reading back the generated id on MySQL when the identity property is0. #17689Phalcon\Mvc\Model::save()leaving the transaction of the related records open when an exception is thrown during the save; the transaction is now rolled back before the exception is thrown again. #17756Phalcon\Mvc\Model\Manager::getModelSource()ignoringSourceattributes whenAttributesReaderis configured. #17741Phalcon\Mvc\Model\Query::getCache()declaringPhalcon\Db\Adapter\AdapterInterfaceas the return type instead of?Phalcon\Cache\CacheInterface. #17796Phalcon\Mvc\Model\Query::getIntermediate()throwing aTypeErrorafterparse()got the intermediate representation from the cache. #800Phalcon\Mvc\Model\Query\Builder::__construct()crashing with OPcache when the parameters have emptybindorbindTypesarrays. #17725Phalcon\Mvc\Model\Query\Lang::parsePHQL()ignoring theorm.enable_literalsandorm.cache_levelvalues set withPhalcon\Mvc\Model::setup()orPhalcon\Support\Settings::set(). #17797Phalcon\Mvc\Model\Querygiving an "Undefined array key" warning for a join with noONcondition whenenable_implicit_joinsis disabled; the query still throwsPhalcon\Db\Exceptions\InvalidSqlExpression. #816Phalcon\Mvc\Model\Queryreusing a cached intermediate representation that was built with the other value of theenable_implicit_joinsoption. #800Phalcon\Mvc\Model\Resultset\ComplexandPhalcon\Mvc\Model\Resultset\Simpleputting their cache in the serialized data, which failed for a cache that cannot be serialized, such as a Redis connection. A resultset from the cache now has no cache (getCache()returnsnull). #17766Phalcon\Mvc\View\Engine\Volt\Compiler::compile()rendering serialized blocks for the second child of a layout whenstatisfalse. #17674Phalcon\Mvc\View\Engine\Volt\Compiler::compileCall()silently dropping{% call %}blocks instead of throwing an exception. #17676Phalcon\Mvc\View\Engine\Volt\Compiler::compileEcho()escaping the output of the escape filters (e,escape,escape_attrand others) a second time whenautoescapeis on. #17678Phalcon\Queue\Consumer\Worker::handleSignal()throwing anArgumentCountErrorwhen the worker receives a signal. #17719Phalcon\Storage\Adapter\RedisClusterandPhalcon\Cache\Adapter\RedisClusterusing a string instead of an array as the defaulthostsoption. #17762Phalcon\Support\Debug::debugVar()storing the arguments and objects of each backtrace frame. #17746Phalcon\Support\Debug::onUncaughtException()discarding only one output buffer level. #17739Phalcon\Support\Debug::onUncaughtException()turning a warning raised while rendering into a fatal error and echoing later exception messages without escaping. #17733Phalcon\Support\Debug::setBlacklist()filtering only the top-level keys of the request and server data. #17736Phalcon\Support\Debug\Dump::variable()not escaping public property names in the HTML output. #17729Phalcon\Support\Debug\Dump::variable()printing the key after a skipped key on the same line. #17746Phalcon\Support\Debug\Dump::variable()throwing anErrorin detailed mode for typed properties that have no value. #17735Phalcon\Support\Debug\Renderer\HtmlRenderer::getVarDump()to call reflection on private methods and only on objects. #17743Phalcon\Support\Debug\Renderer\HtmlRenderer::render()dropping invalid UTF-8 text and not escaping quotes, class names and file paths. #17731Phalcon\Support\Debug\Renderer\HtmlRenderer::render()not showing the previous exceptions, and showing files in a Windows\vendor\folder as application code. #17746Phalcon\Support\Debug\Renderer\HtmlRenderer::render()stopping the debug page for objects with adump()method that is not public, is static, has required parameters or does not return an array. #17735Phalcon\Support\Debug\ReportBuilder::build()reading a file again for each frame, and linking Phalcon classes to API pages that do not exist. #17746
Removed
- Removed the
{% cache %}/{% endcache %}Volt tag from the parser; it now raises a syntax error. #17677 - Removed the unused
modekey from the code fragment ofPhalcon\Support\Debug\Report\BacktraceItem::getFragment(). #17748
Upgrade Notes
- A callback that cannot be called (an unknown function or method, a method that is not public, or an object with no
__invoke()) now throws the PHPTypeErrorofcall_user_func()orcall_user_func_array(). Before, Phalcon gave a warning and returnednull. This comes from Zephir 1.9.0. It applies, for example, to thePhalcon\Diservice definitions andcalls, thePhalcon\Filter\Filtersanitizers, thePhalcon\Html\TagFactoryandPhalcon\Support\HelperFactoryhelpers, the dispatcher actions, thePhalcon\Mvc\Microhandlers, the router converters and thePhalcon\Mvc\Model\Resultset::filter()callback. Code that checks for the warning or fornullmust catchTypeError. #17766 - The factory closure that
Phalcon\Container\Definition\Processor\ObjectProcessor::process()sets now declares one optional parameter, the container.Phalcon\Container\Definition\ServiceDefinition::buildService()already calls the factory with the container. A call with no arguments still works, and the returned object does not change. #17777 - The PHQL parser now reads
orm.enable_literalsandorm.cache_levelfromPhalcon\Support\Settings. A value set withPhalcon\Mvc\Model::setup()(phqlLiterals) orSettings::set()now takes priority over the ini value. Before, the parser used only the ini value. WithphqlLiteralsset tofalse, a PHQL statement with a literal now throwsPhalcon\Mvc\Model\Exception. #17797 Phalcon\Acl\Adapter\Memory::addRole()andaddComponent()now throwPhalcon\Acl\Exceptions\ForbiddenDelimiterwhen the name of a customRoleInterfaceorComponentInterfacecontains!, as theRoleandComponentclasses do. #17800Phalcon\Acl\Adapter\Memory::isAllowed()now denies the access when the rule has a callback that the ACL cannot call, for example a function that does not exist or a method that is not public. Before, the ACL ignored the callback and used only the rule. Make sure that each rule callback is a closure, a public method or a function that exists. #17800Phalcon\Acl\Adapter\Memory::isAllowed()now firesacl:afterCheckAccessalso for a role that does not exist, with the result of the default action asgranted. A listener of this event now also gets these checks. #17800Phalcon\Annotations\Adapter\Stream::read()now returnsfalsewhen the cache file does not hold aPhalcon\Annotations\Reflectionobject, for example an object of a class that is not allowed, an array, a string, an integer ornull. Before, it returned that value.get()now parses the class again and writes a new cache file, the same as for a missing cache file. #17773Phalcon\Annotations\Adapter\Stream::write()now puts<?php __halt_compiler();(Stream::FILE_HEADER) at the start of each cache file, andread()removes it.read()still reads a file with no header. An earlier version cannot read the new files: clear theannotationsDirfolder after a downgrade. #17812Phalcon\Auth\Manager::access()now throwsPhalcon\Container\Exceptions\Exceptionwhen the access gate is registered inPhalcon\Di\Dias a built object withset(), as it already did forsetShared(). Register the class name or a closure instead, so that each activation gets a new gate. #17806Phalcon\Cache\AbstractCacheandPhalcon\Storage\Adapter\AbstractAdapternow callfireManagerEvent()only when an events manager is set.Phalcon\Acl\Adapter\Memory::isAllowed()does the same for theacl:afterCheckAccessevent; theacl:beforeCheckAccessevent does not change. A subclass that overrides the protectedfireManagerEvent()method no longer gets these calls when no events manager is set. With an events manager, nothing changes. #17703Phalcon\Config\Config::path()no longer callshas()for each key of the path. It callshas()for the full path and, for the last key, only whenget()returnsnulland the default value is notnull. A subclass ofConfigor of its adapters that overrideshas()no longer controls the key walk. The result ofpath()does not change. A path through a value that is not a collection still throws anError; its message now namesget()instead ofhas(). #17714Phalcon\Config\Config::setData()now callsvalidateType()only when the config has a type. A subclass ofConfigor of its adapters that overrides the protectedvalidateType()method no longer gets this call when the config has no type. With a type, nothing changes. #17702Phalcon\Contracts\Db\Adapter\Adapter::fetchColumn()andPhalcon\Db\Adapter\AbstractAdapter::fetchColumn()now declaremixedas the return type instead ofstring|bool. The returned values do not change: the method returns the value from the database driver, for exampleint,float,stringornull, orfalsewhen the query returns no rows. A class that overridesfetchColumn()can keep thestring|boolreturn type. #17755Phalcon\Db\Adapter\Pdo\Sqlite::describeReferences()now gives one reference for each foreign key. A composite key is one reference with all its columns, in the order of the key. The name of each reference comes from theidofPRAGMA foreign_key_list(foreign_key_<id>), not from the row number. For a table with only single-column keys, the names do not change. For a table with a composite key, the names of the keys that come after it inPRAGMA foreign_key_listchange, because there are fewer references. #17814Phalcon\Db\Dialect::checkColumnType()now declaresintas the return type instead ofstring, andPhalcon\Mvc\Model\Query::getCache()now declares?Phalcon\Cache\CacheInterfaceinstead ofPhalcon\Db\Adapter\AdapterInterface. The returned values do not change:checkColumnType()returns the column type, which is anint, andgetCache()returns the cache, ornullbeforeexecute()runs with thecacheoption. A class that overrides one of these methods must declare a compatible return type (intforcheckColumnType(),?Phalcon\Cache\CacheInterfaceorPhalcon\Cache\CacheInterfaceforgetCache()), or PHP raises a fatal error when it loads the class. #17796Phalcon\Db\Dialect\Postgresql::describeReferences()now gives the schema of the referenced table asREFERENCED_TABLE_SCHEMA, andPhalcon\Db\Adapter\Pdo\Postgresql::describeReferences()gives it inReference::getReferencedSchema(), for examplepublic. Before, both gave the name of the database. Code that comparesgetReferencedSchema()with the name of the database must use the name of the schema. #17816Phalcon\Encryption\Security::hash()now converts a numeric stringcostoption to an integer. A fractional value such as'5.7'becomes5. Before, theCRYPT_BLOWFISH_AandCRYPT_BLOWFISH_Xalgorithms put the string in the salt ($2a$5.7$), andcrypt()returned the failure string*0. Integer costs and integer strings such as'5'give the same hashes as before. #17779Phalcon\Encryption\Security::hash()now uses the work factor (getWorkFactor(), default10) when thecostoption is empty (null,0,'0',falseor''), the same as when the option is missing. Before, it used the cost4. New hashes for these values take longer to make.checkHash()still verifies the older hashes, because each hash keeps its own cost. #17764Phalcon\Flash\AbstractFlashnow returns the default message template as a constant and no longer callstoInterpolate()for it. A subclass ofPhalcon\Flash\DirectorPhalcon\Flash\Sessionthat overrides the protected statictoInterpolate()method gets one call for each message with automatic HTML instead of two. The output does not change. #17704Phalcon\Html\Link\LinkProvider::getLinks()andPhalcon\Html\Link\EvolvableLinkProvider::getLinks()now return arrays keyed byspl_object_id()(integers) instead ofspl_object_hash()(strings). Code that builds or looks up these keys withspl_object_hash()must usespl_object_id().getLinksByRel()is not affected. #17687Phalcon\Http\Request\Bag\AbstractBag::normalizeKey()now declaresint|stringas the return type instead ofstring. The returned values do not change: anintkey is still returned as anint. A class that overridesnormalizeKey()can keep thestringreturn type. #17771Phalcon\Mvc\Model\Manager::getModelSource()now reads thePhalcon\Annotations\Models\MetaData\Sourceattribute of a model class when theannotationsservice usesPhalcon\Annotations\AttributesReader. A model with#[Source('x')]and nosetSource()now uses the tablex, with the model prefix, instead of the name from its class. ASourceattribute with a missing, empty or non-string table now throwsPhalcon\Mvc\Model\Exception. With the default docblock reader, nothing changes. #17741Phalcon\Mvc\Model\Resultset\SimpleandPhalcon\Mvc\Model\Resultset\Complexno longer put their cache in the serialized data (serialize()and__serialize()). A resultset that comes from the models cache, or fromunserialize(), now returnsnullfromgetCache(). Before, it returned a copy of the cache with no connection. Code that needs the cache must get themodelsCacheservice from the container. In data that an older version serialized, the cache entry is ignored. #17766Phalcon\Mvc\Router\Route::getIndexData()now callsgetCompiledHostName()only when the route has a host name. For a route with no host name,getIndexData()[3]is nownull, also when a subclass overridesgetCompiledHostName(). Routing does not change. #17693Phalcon\Paginator\Adapter\AbstractAdapternow creates the repository in its constructor. A custom adapter that overrides__construct()must callparent::__construct(), orgetRepository()throws anError. #17750Phalcon\Queue\Consumer\Worker::handleSignal()now has a second optional parameter. A subclass that overrides this method must declarehandleSignal(int $signal, ?array $info = null): void, or PHP raises a fatal error when it loads the class. #17719Phalcon\Session\Adapter\AbstractAdapterandPhalcon\Session\Adapter\Noopnow implementSessionIdInterfacewithcreate_sid(): string. Subclasses that overridecreate_sid()must declare thestringreturn type. New session IDs now come from the adapter as 32 hex characters, sosession.sid_lengthandsession.sid_bits_per_characterno longer apply to these adapters. Custom handlers that implementSessionHandlerInterfacedirectly must addcreate_sid()andvalidateId()to avoid the PHP 8.6 deprecation. #17687Phalcon\Support\Collection::remove()no longer callshas(), and it calls the protectedprocessKey()method one time instead of two. A subclass that overrideshas()no longer controls whatremove(),__unset()andoffsetUnset()do. #17683Phalcon\Support\Collection::setData()now callsvalidateType()only when the collection has a type. A subclass that overrides the protectedvalidateType()method no longer gets this call (also from the constructor,init(),set(),offsetSet()and__set()) when the collection has no type. With a type, nothing changes. #17683Phalcon\Support\Debugnow records the output buffer level when it is created.onUncaughtException()discards all the output buffers that start after that point and keeps the buffers that started before it, for example fromoutput_bufferingorzlib.output_compressionin php.ini. Before, it discarded only the top buffer, also when that buffer started beforeDebugwas created. To discard the output of your own buffers, createDebugbefore you start them. #17739