NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist · #708 most downloaded on Packagist
PostHog PHP Library
Last release 10 days ago
28 Sep 2026
Ships fairly regularly
a new release about every 1 weeks
Most releases are documented
notes for 49 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
5 years old
84 releases · first in 2021
One column per quarter.
Preserve escaped characters in gzip-compressed fork-curl event payloads.
Read the release id from the POSTHOG_RELEASE_ID environment variable and send it as $release_id on every event, including minimal $feature_flag_called
POSTHOG_RELEASE_ID environment variable and send it as $release_id on every event, including minimal $feature_flag_called events. On $exception events, error tracking uses it to link the exception to its release by a direct id lookup. Create the release and get its id with posthog-cli release resolve. An explicit $release_id in the event properties or in the request context wins over the environment variable. Under PHP-FPM, pass the variable through to workers (clear_env = no or an env[POSTHOG_RELEASE_ID] pool entry).Honor the definitions snapshot's property_matching_version during local feature flag evaluation, including group, cohort, and flag dependency conditio
property_matching_version during local feature flag evaluation, including group, cohort, and flag dependency conditions. Version 2 uses explicit boolean matching; missing or other versions retain legacy matching. Preserve the selector across external definition caches and reloads.Resolve feature flag payloads during local evaluation from the definition's filters.payloads , so evaluateFlags()->getFlagPayload() and getFeatureFlag
filters.payloads, so evaluateFlags()->getFlagPayload() and getFeatureFlagPayload() no longer return null for locally evaluated flags.Match local feature flag boolean coercion, JSON stringification, numeric formatting, and string case handling with the flags service.
Return false for the is_not_set operator during local evaluation when the property key is present.
is_not_set operator during local evaluation when the property key is present.Return an empty feature flag snapshot without evaluation requests when the requested flag key list is empty.
Apply batch payload size checks consistently before transport processing
Normalize SDK timestamps to UTC before serialization.
Preserve fractional seconds and emit event timestamps in UTC.
Support the starts_with , not_starts_with , ends_with , and not_ends_with property filter operators in feature flag local evaluation. Matching is case
Support the starts_with, not_starts_with, ends_with, and not_ends_with property filter operators in feature flag local evaluation. Matching is case-insensitive and mirrors icontains. Previously, local evaluation treated these operators as unrecognized and silently evaluated their conditions to false; they now match correctly.
Operators local evaluation doesn't recognize now throw InconclusiveMatchException, deferring the flag to the /flags endpoint instead of producing a silently wrong false — so operators the server adds in the future degrade gracefully.
test: release with new changeset management
45c1b23 : Send minimal $feature_flag_called events when the server enables the minimal_flag_called_events gate and the flag is not linked to an experi
a657369 : Emit error tracking stack frames in the canonical bottom-up order: stacktrace.frames[0] is now the outermost/entry-point call and the last f
stacktrace.frames[0] is now the outermost/entry-point call and the last frame is the crash site. This aligns the PHP SDK with the cross-SDK stack frame ordering standard.c6c637c : Add a $feature_flag_has_experiment boolean property to $feature_flag_called events, mirroring the server's has_experiment field. The propert
fa53311 : Add a before_send callback for modifying or dropping fully enriched events.
3ab7c80 : Stop duplicating distinct_id inside /flags person properties.
6db62ec : Retry remote feature flag requests after transient 502 and 504 responses.
afa2dde: Harden the automated release workflow.
b1a5645: Retry capture delivery on transient HTTP errors and respect Retry-After responses.
8974819: Fall back to uncompressed batch uploads when local gzip compression fails.
2f594df: Retry feature flag requests after transient network errors only. The feature flag request retry count defaults to 1 and can be set to 0 to di
a6f28af: Dedupe feature flag called events by response value.
5ed7184: Validate top-level event UUIDs and replace invalid values with generated UUIDs.
21514df: Retain queued batches after network or timeout flush failures.
6e8b141: Copy capture groups input to the $groups event property so grouped events are associated correctly.
groups input to the $groups event property so grouped events are associated correctly.fac3a93: Add an external flag definition cache provider for sharing local-evaluation definitions across PHP SDK instances.
3ff0479: Add configurable flush interval support for queued event batching.
b7b6cf0: Stop sending deprecated, backend-ignored top-level batch event fields. SDK metadata now uses canonical event properties ($lib, $lib_version,…
$lib, $lib_version, $lib_consumer), while legacy top-level SDK metadata values remain supported as fallbacks when canonical values are absent. type is ignored, and send_feature_flags remains a deprecated capture option but is stripped from the outgoing /batch/ payload.4e0eb86: Support the early_exit flag filter in local evaluation. When a flag's filters.early_exit is true and a condition group's property filters mat
early_exit flag filter in local evaluation. When a flag's filters.early_exit is true and a condition group's property filters match (or there are none) but the rollout percentage excludes the user, evaluation now stops and returns false immediately instead of falling through to later groups. Mirrors the server-side (Rust) evaluation engine. A property-filter mismatch still falls through as before, and behaviour is unchanged when early_exit is unset or false.aa10180: Add a configurable $is_server event property (default true) so PostHog can identify server-side events. Set is_server to false when using pos
$is_server event property (default true) so PostHog can identify server-side events. Set is_server to false when using posthog-php as a client/CLI so the device OS is attributed normally.ccba73f: No-op facade and feature flag APIs when the SDK is uninitialized or non-operational.
e26230c: Move const inside class to prevent memory leaks in worker mode
806dd0b: Initialize a disabled no-op client instead of throwing or sending requests when the API key is missing or blank.
83afee8: Include group context in the $feature_flag_called dedupe element so group-scoped flags fire a separate event for each group a user is evaluat
$feature_flag_called dedupe element so group-scoped flags fire a separate event for each group a user is evaluated under, instead of being dedup-ed against the first group context the same (distinct_id, flag) was seen under.9adcdd6: Add request context helpers for propagating request metadata and optional PostHog tracing headers.
distinctId/distinct_id override for groupIdentify() events.feat(flags): Deprecate isFeatureEnabled(), getFeatureFlag(), getFeatureFlagResult(), getFeatureFlagPayload(), and the send_feature_flags capture() opt…
feat(flags): Add evaluateFlags() API for single-call flag evaluation. Returns a
FeatureFlagEvaluations snapshot you can read repeatedly without further /flags requests; pass
it to capture() via the new flags key to attach $feature/<key> and $active_feature_flags
on the captured event without an extra round trip.
feat(flags): Deprecate isFeatureEnabled(), getFeatureFlag(), getFeatureFlagResult(),
getFeatureFlagPayload(), and the send_feature_flags capture() option in favor of
evaluateFlags(). Each emits an E_USER_DEPRECATED warning pointing at the new API; existing
callers keep working unchanged until the next major version. getAllFlags() is intentionally
not deprecated — it returns an arbitrary key list the snapshot API doesn't yet cover.
fix(flags): SizeLimitedHash::contains() and add() were storing entries on the outer map and
comparing values to keys, so the per-distinct_id $feature_flag_called dedup never matched after
the first event. Both helpers now operate on a per-key set as intended.
- Full Changelog
- Full Changelog
- Full Changelog
- Full Changelog
- Full Changelog
- Full Changelog
- Full Changelog
- Full Changelog
- Full Changelog
- Full Changelog
- Full Changelog
Fix PHP 8.4 deprecation on Client.php constructor (Backwards Compatible)
feat(flags): Add ETag support for local evaluation caching
feat(flags): include evaluated_at properties in $feature_flag_called events
flag filter type in local evaluation (#80)/flags endpoint instead of /decide (#76)feat: Add request id, version, id, and evaluation reason to $feature_flag_called events (#75)
feat(flags): Add getFeatureFlagPayload method (#53)
feature_flag_request_timeout_ms timeout parameter for feature flags which defaults to 3 seconds, updated from the default 10s for all other API calls.Merge pull request #19 from PostHog/handle-host
fix tests for good
check if host exists before operating on it
undefined check
fix tests
Allow hosts with protocol specified
Merge pull request #18 from PostHog/feature-flags
remove useless comment
have env var as the secondary option
bump version
bring back destruct
remove feature flags
simplify everything
Cleanup isFeatureEnabled docblock
Fix user agent undefined array key
Merge pull request #17 from PostHog/releasing-update
Note git-extras in RELEASING.md
Add test case for isFeatureEnabled with the simple flag in the mocked response
Fix: make rolloutPercentage nullable in isSimpleFlagEnabled
Merge remote-tracking branch 'upstream/master'
Fix is_simple_flag tests by mocking response
Use LONG_SCALE const
Implement isSimpleFlagEnabled
Don't set payload on get requests
(WIP) Rework feature flags based on spec https://github.com/PostHog/posthog.com/pull/1455
Extract http client functionalities
Remove extra line
Change default host to app.posthog.com
Feature/support feature flags decide API
Allow for setup via environment variables POSTHOG_API_KEY and POSTHOG_HOST
Make code adhere to PSR-4 and PSR-12
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →