- Custom
types\DateIntervalclass. ItsformatAsISO8601()static method was moved toconverters\datetime\IntervalConverter,input()method of that converter now returns instances of native\DateIntervalclass.
Features deprecated in 2.x releases were removed, specifically
ResultSetclass -- useResult.- Getter / "isser" methods of classes for complex PostgreSQL types, use the properties instead. The methods were
needed previously to support magic readonly properties, now these properties are native
public readonlyand the following methods are no longer available:types\Circle:getCenter(),getRadius();types\Line:getA(),getB(),getC();types\Path:isOpen();types\Point:getX(),getY();types\Boxandtypes\LineSegment:getStart(),getEnd();types\Range:getLower(),getUpper(),isLowerInclusive(),isUpperInclusive(),isEmpty();types\Tid:getBlock(),getTuple().
types\ReadOnlyPropertiestrait previously used to implement magic readonly properties.converters\BaseConverter::getStrspn()method.- Methods mentioning
resource, as pgsql extension in PHP 8.1+ no longer uses resources:Connection::getResource()-- useConnection::getNative();Result::getResource(),Result::createFromResultResource()-- useResult::getNative()andResult::createFromReturnValue().
- Methods of
converters\DefaultTypeConverterFactorythat are now part ofconverters\TypeOIDMapperinterface orconverters\CachedTypeOIDMapperclass:findTypeNameForOID()/findOIDForTypeName();isArrayTypeOID()/isRangeTypeOID()/isMultiRangeTypeOID()/isDomainTypeOID()/isCompositeTypeOID()/isBaseTypeOID();setCompositeTypesCaching()/getCompositeTypesCaching().
Connection::checkRollbackNotNeeded()method -- useConnection::assertRollbackNotNeeded().$paramsand$resultTypesarguments ofPreparedStatement::execute(). It will now execute the statement using only the previously bound values and passing previously specified result types toResult.
- Static
formatAsISO8601()from removedtypes\DateIntervalclass toconverters\datetime\IntervalConverter. - Protected
nextChar()andexpectChar()fromconverters\BaseConvertertoconverters\ContainerConverter. TypeConverterFactoryinterface now extendsconverters\ConnectionAware, thussetConnection()method of it and its implementations has a return type ofvoid.
These are now represented by cases of SqlState enum instead of ServerException class constants.
Before:
try {
// ...
} catch (ServerException $e) {
if ($e::UNIQUE_VIOLATION === $e->getSqlState()) {
// handle unique violation
}
}now
try {
// ...
} catch (ServerException $e) {
if (SqlState::UNIQUE_VIOLATION === $e->getSqlState()) {
// handle unique violation
}
}Constructor of classes representing range types, backed by types\RangeConstructor interface, now has
the fifth bool $empty = false argument used to create empty ranges
$emptyRange = new NumericRange(empty: true);Custom subclasses of types\Range should be updated accordingly. Range::createEmpty() still works:
$emptyRange = NumericRange::createEmpty();Typehints were added for method arguments and return values where not previously possible or omitted, specifically
int|stringtypehints for methods dealing with OID values:$oidargument ofTypeConverterFactory::getConverterForTypeOID()and its implementations,- Return value of
Result::getTableOID(), - Return value of
converters\TypeOIDMapper::findOIDForTypeName()and its implementations, $oidargument offindTypeNameForOID(),isBaseTypeOID(), andisCompositeTypeOID()methods inconverters\TypeOIDMapperand their implementations,$oidand$baseTypeOidarguments forisArrayTypeOID(),isDomainTypeOID(),isRangeTypeOID(), andisMultiRangeTypeOID()methods inconverters\TypeOIDMapperand their implementations;
int|stringtypehints for$fieldIndexarguments ofsetType(),fetchColumn(), andgetTableOID()methods inResultclass;int|string|nulltypehint for$keyColumnargument ofResult::fetchAll().statictypehint for return value oftypes\ArrayRepresentable::createFromArray()