posthog / posthog-php
PostHog PHP Library
4.1.1
2026-03-30 12:02 UTC
Requires
- php: >=8.2
- ext-json: *
- symfony/clock: ^6.2|^7.0|^8.0
Requires (Dev)
- phpunit/phpunit: ^11.0
- squizlabs/php_codesniffer: ^3.7
- dev-master
- 4.1.1
- 4.1.0
- 4.0.4
- 4.0.3
- 4.0.2
- 4.0.1
- 4.0.0
- 3.7.3
- 3.7.2
- 3.7.1
- 3.7.0
- 3.6.0
- 3.5.0
- 3.4.0
- 3.3.5
- 3.3.4
- 3.3.3
- 3.3.2
- 3.3.1
- 3.3.0
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.0
- 3.0.8
- 3.0.7
- 3.0.6
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.1.1
- 2.1.0
- 2.0.6
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- dev-feat/php-errortracking
- dev-codex/fix-clock-lockfile-ci
- dev-chore/check-in-composer-lock
- dev-fix/increase-batch-size-limit
- dev-docs/extract-releasing-to-own-file
- dev-chore/add-codeql-workflow
- dev-fix/ssl-detection-with-http-host
- dev-feat/semver-targeting
- dev-matheus-vb/fix-failed-flag-overwrite
- dev-feat/get-feature-flag-result
- dev-ci/notify-release-rejected
- dev-vdekrijger-add-github-releaser-app
- dev-vdekrijger-bump-to-php85
- dev-fix/send-feature-flags
- dev-haacked/etag-support
- dev-cut-releases-when-deploying-new-version-php
- dev-feat/publish-evaluated-at-events
- dev-posthog/task-PHA-102
- dev-posthog/task-PHA-104
- dev-posthog/task-PHA-103
- dev-posthog/task-MCP-6
- dev-posthog/task-PHA-100
- dev-posthog/task-PHA-99
- dev-posthog/task-PHA-89
- dev-haacked/static-cohort-local-eval-fix
- dev-andyzzhao/dont-sort-variant-overrides
- dev-feat/transactional-queue-prevent-data-loss
- dev-fix/handle-flushing-events-with-32kb-limit
- dev-haacked/ignore-flag-dependencies
- dev-chore/bump-version
- dev-chore/use-flags
- dev-fix/try-this-instead
- dev-feat/feature-flag-payloads
- dev-fix-makefile-version
- dev-non-blocking-lib-curl
- dev-pnctl-fork-async
- dev-fix-bool-match
- dev-cohort-local-eval
- dev-add-flag-timeout
- dev-update-names
- dev-local-prop
- dev-prop-matching
- dev-neilkakkar-patch-1
- dev-fix-decide-v2
- dev-alisqi/master
- dev-fix-bug
- dev-groups-fix
- dev-timeout-configurable
- dev-php-unit/cs-version
- dev-update-version-3.0.1
- dev-ff-overrides
- dev-update-history-3.0.0
- dev-ff-remove-defaultvalue
- dev-turbo
- dev-group-analytics-flags
- dev-group-analytics-support
- dev-handle-host
- dev-feature-flags
- dev-zidsa/master
This package is auto-updated.
Last update: 2026-04-01 16:07:17 UTC
README
Please see the main PostHog docs.
Specifically, the PHP integration details.
Features
- ✅ Event capture and user identification
- ✅ Feature flag local evaluation
- ✅ Feature flag dependencies (new!) - Create conditional flags based on other flags
- ✅ Multivariate flags and payloads
- ✅ Group analytics
- ✅ Comprehensive test coverage
Quick Start
- Copy
.env.exampleto.envand add your PostHog credentials - Run
php example.phpto see interactive examples of all features
Questions?
Join our Slack community.
Contributing
- Download PHP and Composer
php composer.phar updateto install dependenciesbin/testto run tests (this script calls./vendor/bin/phpunit --verbose test)
Releasing
See RELEASING.md.