feature-flags-php

Implement and evaluate PostHog feature flags in PHP applications.

58|5|Updated Jan 19, 2026
One-click install
npx skills add https://github.com/PostHog/skills --skill feature-flags-php
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: feature-flags-php
Source: https://github.com/PostHog/skills/tree/main/skills/posthog/feature-flags/skills/php
Command: npx skills add https://github.com/PostHog/skills --skill feature-flags-php

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This PHP skill streamlines implementing PostHog feature flags in PHP apps, reducing risk of hard-coded keys and improving flag-driven behavior.

Core Features & Use Cases

  • Integrates PostHog feature flags in PHP applications with PHP SDK calls like isFeatureEnabled and getFeatureFlag.
  • Demonstrates how to enable sending flag data in events and how to override properties for accurate evaluations across environments.
  • Use case: add a boolean flag to toggle a beta feature behind authentication, or switch variants for A/B tests on server-side logic.

Quick Start

Initialize the PHP client with your PostHog project token and evaluate a flag for a user to drive conditional logic.

Frequently Asked Questions about feature-flags-php

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I evaluate PostHog feature flags in a PHP application?▼

To evaluate PostHog feature flags in a PHP application, initialize the PHP client with your project token and use SDK calls like isFeatureEnabled or getFeatureFlag to drive server-side conditional logic.

Can I use multivariate feature flags for A/B testing on the server side?▼

Yes, you can use multivariate feature flags for server-side A/B testing. The implementation supports evaluating boolean and multivariate flags to switch variants and control feature exposure across environments.

What is the best way to manage PostHog project tokens in PHP apps?▼

The best way to manage PostHog project tokens in PHP apps is by using environment variables. This approach enforces server-side best practices and reduces the risk of hard-coding keys in your application logic.

How do I send feature flag data in PHP server-side events?▼

You can send feature flag data in PHP server-side events by configuring the PostHog PHP SDK to attach flag evaluation metadata. This event-flag integration tracks how boolean and multivariate flags impact user interactions.

Does PostHog PHP SDK support overriding properties for accurate feature flag evaluations?▼

Yes, the PostHog PHP SDK supports overriding properties to ensure accurate feature flag evaluations across environments. This allows you to tailor server-side flag logic for specific user contexts during testing.