Need help with Gherkin?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

930 Stars 86 Forks MIT License 591 Commits 20 Opened issues


Gherkin parser, written in PHP 5.3+ for Behat project

Services available


Need anything else?

Contributors list

Behat Gherkin Parser

This is the php Gherkin parser for Behat. It comes bundled with more than 40 native languages (see

) support & clean architecture.

Useful Links

Usage Example

        'feature'          => 'Feature',
        'background'       => 'Background',
        'scenario'         => 'Scenario',
        'scenario_outline' => 'Scenario Outline|Scenario Template',
        'examples'         => 'Examples|Scenarios',
        'given'            => 'Given',
        'when'             => 'When',
        'then'             => 'Then',
        'and'              => 'And',
        'but'              => 'But'
    'en-pirate' => array(
        'feature'          => 'Ahoy matey!',
        'background'       => 'Yo-ho-ho',
        'scenario'         => 'Heave to',
        'scenario_outline' => 'Shiver me timbers',
        'examples'         => 'Dead men tell no tales',
        'given'            => 'Gangway!',
        'when'             => 'Blimey!',
        'then'             => 'Let go and haul',
        'and'              => 'Aye',
        'but'              => 'Avast!'
$lexer  = new Behat\Gherkin\Lexer($keywords);
$parser = new Behat\Gherkin\Parser($lexer);

$feature = $parser->parse(file_get_contents('some.feature'));

Installing Dependencies

$> curl | php
$> php composer.phar update


We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.