CEL-PHP 2.0.0
cel-php 2.0 is a major release that aligns the evaluator with the CEL specification and cel-go. Highlights: numeric comparisons and null equality (proposal 210), optional values (proposal 246), two-variable comprehensions, timestamp/duration arithmetic, matches(), protobuf well-known types, and qualified-name resolution, plus overflow-checked integer math and corrected timestamp, conversion, and map-key semantics. Several changes are breaking; read UPGRADE-2.0.md before upgrading.
✨ Features
Language
- Numeric comparison & null equality: CEL proposal 210, total and cross-type
==/!=/ordering. (#113, f4a06a8) - Optional values: implement CEL proposal 246 (
optional.of/none,orValue, optional selection,has()). (#105, eb12de0) - Two-variable comprehensions:
all/exists/existsOne(i, v, p),transformList/transformMap, error absorption. (47990f9) - Qualified names: longest-prefix name resolution and the leading-dot (
.foo) reference. (bb3ea8b) - List indexing: index lists by uint or integral double;
has()sees through optionals. (dd34c62)
Types
dynandtypevalues: first-class type values,dyn()identity, spec-aligned conversions. (021f97f)- Tagged map keys: distinct bool/int/uint/string keys, no collisions, uint beyond
PHP_INT_MAX. (d041fd8) - Well-known types: construct the
google.protobufscalar wrappers andValue. (5d9ec16)
Standard library
matches(): regex string function with Unicode partial matching. (98a9c6b)- Timestamp/duration arithmetic: the six
+/-overloads, range-checked. (ef087df)
Extensions
- ext-decimal 2.0: the Decimal extension is now compatible with
ext-decimal2.0. (9a34cf6)
🐛 Bug Fixes
Numbers
- int64 overflow: integer
+,-,*, and negation now raise on overflow instead of wrapping. (018d4c5) - Conversion overflow:
int(double), unsigned+/*, and timestamp/duration reject out-of-range values. (00130ad) - Large uint literals: preserve
uintliterals beyond the signed 64-bit range. (7177b37)
Types
- Unsigned integer typing: type the unsigned value as
int|numeric-string. (442967f) - Timestamp/Duration type name:
type()reportsgoogle.protobuf.TimestampandDuration. (a7c728b)
Parser
- Base-prefixed literals: parse
0x,0o, and0binteger literals in their real base (were0). (2f1c904) - RFC3339 parsing: parse timestamps on the proleptic Gregorian calendar. (2469ff3)
Date & time
- Timestamp accessors: correct CEL semantics for the day, date, millisecond, and timezone accessors. (a2a4445)
string(timestamp): format as RFC 3339 with only significant fractional digits. (c152f1d)
📖 Documentation
- Upgrade guide: add
UPGRADE-2.0.mdcovering every breaking and behavioural change since 1.2.1. (baf3840)
🏗️ Internal
- Dependencies: drop bundled Psl components, split
php-standard-libraryinto packages, useext-mbstring. (0885373, f5c7c97, 74e1610, bad7255) - API surface: mark every symbol
@apior@internal, and throw only project exceptions. (13f9265, 4abeb69) - Quality: reach 100% mutation score with Mago and Infection, and tighten the analyzer config. (b038374, 8c38010)
- Packaging: harden packaging, CI, and release tooling. (e40ef2c)
🙏 Thank You
Issue Reporters
Thank you to everyone who reported issues that shaped this release:
Full Changelog: 1.2.1...2.0.0