PackageTrack
Sign in Get early access

behat/gherkin

Gherkin DSL parser for PHP

v4.17.0 190M downloads/mo #399 most downloaded on Packagist Behat/Gherkin

What this package is like to depend on

Last release 3 months ago

18 May 2026

Ships unpredictably

gaps range from 1 weeks to 3.0 years

Rarely documented

notes for 10 of 68 stable releases

Nothing withdrawn

no release was ever pulled

15 years old

68 releases · first in 2011

4 releases in the last 12 months

see the full history below

Release timeline

68 releases · Dec 2011 to May 2026
2012 2014 2016 2018 2020 2022 2024 2026
Release Pre-release

Releases

latest 60 of 68
  1. v4.17.0 18 May 2026
    Release notes

    Changed

    • Emit deprecation if filter string does not contain @ prefixes by @acoulton in #417

    Added

    • Add a getFullText() method to a StepNode - returns the keyword & text as it appears in the feature file by @acoulton in #421

    Fixed

    • Wrap NoSuchLanguageException in a parser exception by @stof in #419
    • Ignore whitespace around operators in tag filter strings by @acoulton in #416

    Internal

    • Update cucumber/gherkin parity tests and translations to v39.1.0 by @behat-gherkin-updater[bot] in #409, #411, and #420
    • refactor: Only parse tag filter expression once by @acoulton in #418
    • Fix Phpstan errors in current master build by @acoulton in #413
    • Bump github actions versions by @dependabot[bot] in #412, #414 and #415
    Open source →
    Release notes

    Changed

    • Emit deprecation if filter string does not contain @ prefixes by @acoulton in https://github.com/Behat/Gherkin/pull/417

    Added

    • Add a getFullText() method to a StepNode - returns the keyword & text as it appears in the feature file by @acoulton in https://github.com/Behat/Gherkin/pull/421

    Fixed

    • Wrap NoSuchLanguageException in a parser exception by @stof in https://github.com/Behat/Gherkin/pull/419
    • Ignore whitespace around operators in tag filter strings by @acoulton in https://github.com/Behat/Gherkin/pull/416

    Internal

    • Update cucumber/gherkin parity tests and translations to v39.1.0 by @behat-gherkin-updater[bot] in https://github.com/Behat/Gherkin/pull/409, https://github.com/Behat/Gherkin/pull/411, and https://github.com/Behat/Gherkin/pull/420
    • refactor: Only parse tag filter expression once by @acoulton in https://github.com/Behat/Gherkin/pull/418
    • Fix Phpstan errors in current master build by @acoulton in https://github.com/Behat/Gherkin/pull/413
    • Bump github actions versions by @dependabot[bot] in https://github.com/Behat/Gherkin/pull/412, https://github.com/Behat/Gherkin/pull/414 and https://github.com/Behat/Gherkin/pull/415
    Open source →
  2. v4.16.1 08 Dec 2025
    Release notes

    Fixed

    • Reinstate support for tag filter expressions without a leading @ (e.g. wip&&~slow instead of @wip&&~@slow).
      This syntax was never officially supported, but previously worked and was broken by 4.16.0. We have temporarily
      fixed this, but it is deprecated and will be removed in the next major version. By @acoulton in #407
    Open source →
    Release notes

    Fixed

    • Reinstate support for tag filter expressions without a leading @ (e.g. wip&&~slow instead of @wip&&~@slow). This syntax was never officially supported, but previously worked and was broken by 4.16.0. We have temporarily fixed this, but it is deprecated and will be removed in the next major version.
    Open source →
  3. v4.16.0 08 Dec 2025
    Release notes

    Changed

    • Further improvements to parser parity when the experimental gherkin-32 compatibility mode is enabled:
      • Parse descriptions (instead of multiline titles) for all describable nodes by @acoulton in #361
      • Unescape escaped delimiters within doc strings by @stof in #393
      • Retain the @ prefix when parsing tags by @acoulton in #400
      • Trim unicode padding from table cells by @stof in #405

    Fixed

    • Fix the implementation of the default dialect for the keywords provider by @stof in #404

    Internal

    • Add Stringable to classes implementing __toString() by @acoulton in #402
    • Fix cucumber variant assertions to include inherited properties by @acoulton in #394
    • Update cucumber/gherkin parity tests to 37.0.0 by @behat-gherkin-updater[bot] in #397 and #398
    • update_cucumber script should not fail on manually created releases by @acoulton in #396
    • Add funding links and information by @acoulton in #401
    Open source →
    Release notes

    Changed

    • Further improvements to parser parity when the experimental gherkin-32 compatibility mode is enabled:
      • Parse descriptions (instead of multiline titles) for all describable nodes by @acoulton in #361
      • Unescape escaped delimiters within doc strings by @stof in #393
      • Retain the @ prefix when parsing tags by @acoulton in #400
      • Trim unicode padding from table cells by @stof in #405

    Fixed

    • Fix the implementation of the default dialect for the keywords provider by @stof in #404

    Internal

    • Add Stringable to classes implementing __toString() by @acoulton in #402
    • Fix cucumber variant assertions to include inherited properties by @acoulton in #394
    • Update cucumber/gherkin parity tests to 37.0.0 by @behat-gherkin-updater[bot] in #397 and #398
    • update_cucumber script should not fail on manually created releases by @acoulton in #396
    • Add funding links and information by @acoulton in #401
    Open source →
  4. v4.15.0 05 Nov 2025
    Release notes

    Changed

    • Added a new ParserInterface and deprecated extending the core Lexer, Parser and Node classes by @acoulton in #354
    • Deprecate the CucumberNDJsonAstLoader (which was only intended for internal use by our tests) by @stof in #356
    • By default, the parser ignores invalid language tags (e.g. #language:no-such) and falls back to the default language (e.g. en). Previously, the resultant FeatureNode::getLanguage() would return the original invalid value from the feature file - it will now return the language that was actually used for parsing. By @stof in #350

    Added

    • Introduce a DialectProviderInterface matching the modern cucumber API. This will replace the existing Keywords API in a future major release. By @stof in #350
    • Introduce configurable GherkinCompatibilityMode to control how gherkin files are parsed. In the default legacy mode, there is no change to parsing. In the new experimental gherkin-32 mode, files will in future be parsed consistently with the official cucumber/gherkin parsers. This mode is not yet complete - in this first release:
      • Whitespace within description nodes will not be trimmed by @acoulton in #349
      • Invalid language tags will cause an exception by @stof in #357
      • Step keywords will not be trimmed by @stof in #360
      • Language tags can include whitespace by @acoulton in #358
      • \n literals in table cells will be parsed as newlines by @stof in #359 and #391
    • Improved translations for ru (Russian) and af (Afrikaans) from cucumber/gherkin in #381 and #386
    • Support PHP 8.5 by @acoulton in #388

    Fixed

    • Improve phpdoc / phpstan type-hinting of the lexer and parser by @uuf6429 in #344 and @stof in #363
    • Handle race conditions when creating cache directory by @uuf6429 in #373
    • Throw if Loader->load() called with unsupported resource by @uuf6429 in #372
    • Use default file cache key if behat/gherkin version is unknown by @uuf6429 in #370

    Internal

    Open source →
    Release notes

    Changed

    • Added a new ParserInterface and deprecated extending the core Lexer, Parser and Node classes by @acoulton in #354
    • Deprecate the CucumberNDJsonAstLoader (which was only intended for internal use by our tests) by @stof in #356
    • By default, the parser ignores invalid language tags (e.g. #language:no-such) and falls back to the default language (e.g. en). Previously, the resultant FeatureNode::getLanguage() would return the original invalid value from the feature file - it will now return the language that was actually used for parsing. By @stof in #350

    Added

    • Introduce a DialectProviderInterface matching the modern cucumber API. This will replace the existing Keywords API in a future major release. By @stof in #350
    • Introduce configurable GherkinCompatibilityMode to control how gherkin files are parsed. In the default legacy mode, there is no change to parsing. In the new experimental gherkin-32 mode, files will in future be parsed consistently with the official cucumber/gherkin parsers. This mode is not yet complete - in this first release:
      • Whitespace within description nodes will not be trimmed by @acoulton in #349
      • Invalid language tags will cause an exception by @stof in #357
      • Step keywords will not be trimmed by @stof in #360
      • Language tags can include whitespace by @acoulton in #358
      • \n literals in table cells will be parsed as newlines by @stof in #359 and #391
    • Improved translations for ru (Russian) and af (Afrikaans) from cucumber/gherkin in #381 and #386
    • Support PHP 8.5 by @acoulton in #388

    Fixed

    • Improve phpdoc / phpstan type-hinting of the lexer and parser by @uuf6429 in #344 and @stof in #363
    • Handle race conditions when creating cache directory by @uuf6429 in #373
    • Throw if Loader->load() called with unsupported resource by @uuf6429 in #372
    • Use default file cache key if behat/gherkin version is unknown by @uuf6429 in #370

    Internal

    • Enable PHPStan level 10 and resolve remaining warnings by @uuf6429 in #368
    • Remove duplication and improve robustness in filesystem operations by @uuf6429 in #365 and #367
    • Explicitly cover expected departures from cucumber gherkin parsing with tests by @acoulton in #392
    • Update cucumber/gherkin parity tests to v36.0.0 in #355, #376 #378, #381, #385 #386 and #387
    • Fixes and improvements to the cucumber update CI job by @acoulton in #374, #375, #379 and #380
    • Minor coding style fixes by @acoulton in #377 and #383
    • Minor code improvements to Lexer/Parser implementation by @uuf6429 in #352
    • Minor code improvements to TableNode by @uuf6429 in #366
    • Add native typehints where this does not break BC by @stof in #353
    • Fix typo of a PHPStan alias type by @uuf6429 in #371
    • Fix github actions workflow job name by @uuf6429 in #369
    Open source →
  5. v4.14.0 23 May 2025
    Release notes

    Changed

    • Throw ParserException if file ends with tags by @acoulton in #313
    • Throw ParserException if Background comes after first Scenario by @acoulton in #343
    • For compatibility with the official cucumber/gherkin parsers, we now accept some gherkin syntax that would previously have triggered a ParserException. Users may wish to consider running a tool like gherkin-lint in CI to detect incomplete feature files or valid-but-unusual gherkin syntax. The specific changes are:
      • Parse Scenario and Scenario Outline as synonyms depending on the presence (or not) of an Examples: keyword.
        by @acoulton in #316 and #324
      • Do not throw on some unexpected Feature / Language tags by @acoulton in #323
      • Do not throw on .feature file that does not contain a Feature by @acoulton in #340
      • Ignore content after table right-hand | (instead of throwing) by @acoulton in #341
    • Remove the line length from the NewLine token value by @stof in #338
    • Added precise PHPStan type information by @stof in #332, #333, #339 and #334

    Internal

    • Make private props readonly; fix tests by @uuf6429 in #319
    • Use the Yaml::parseFile API to handle Yaml files by @stof in #335
    • test: Make CucumberND name reading consistent by @uuf6429 in #309
    • test: Use vfsStream to simplify / improve filesystem-related tests by @uuf6429 in #298
    • test: Handle optional tableHeader when loading NDJson examples by @uuf6429 in #294
    • test: Refactor valid ParserExceptionsTest examples into cucumber/gherkin testdata by @acoulton in #322
    • test: Compare step arguments when checking gherkin parity by @acoulton in #325
    • test: Use a custom object comparator to ignore the keywordType of StepNode by @stof in #331
    • ci: Add conventional title to gherkin update, error on missing asserts by @acoulton in #314
    • Assert that preg_split does not fail when splitting a table row by @stof in #337
    • Add assertions in the parser to reflect the structure of tokens by @stof in #342
    • style: Define and change phpdoc order coding style by @uuf6429 in #345
    Open source →
    Release notes

    Changed

    • Throw ParserException if file ends with tags by @acoulton in #313
    • Throw ParserException if Background comes after first Scenario by @acoulton in #343
    • For compatibility with the official cucumber/gherkin parsers, we now accept some gherkin syntax that would previously have triggered a ParserException. Users may wish to consider running a tool like gherkin-lint in CI to detect incomplete feature files or valid-but-unusual gherkin syntax. The specific changes are:
      • Parse Scenario and Scenario Outline as synonyms depending on the presence (or not) of an Examples: keyword. by @acoulton in #316 and #324
      • Do not throw on some unexpected Feature / Language tags by @acoulton in #323
      • Do not throw on .feature file that does not contain a Feature by @acoulton in #340
      • Ignore content after table right-hand | (instead of throwing) by @acoulton in #341
    • Remove the line length from the NewLine token value by @stof in #338
    • Added precise PHPStan type information by @stof in #332, #333, #339 and #334

    Internal

    • Make private props readonly; fix tests by @uuf6429 in #319
    • Use the Yaml::parseFile API to handle Yaml files by @stof in #335
    • test: Make CucumberND name reading consistent by @uuf6429 in #309
    • test: Use vfsStream to simplify / improve filesystem-related tests by @uuf6429 in #298
    • test: Handle optional tableHeader when loading NDJson examples by @uuf6429 in #294
    • test: Refactor valid ParserExceptionsTest examples into cucumber/gherkin testdata by @acoulton in #322
    • test: Compare step arguments when checking gherkin parity by @acoulton in #325
    • test: Use a custom object comparator to ignore the keywordType of StepNode by @stof in #331
    • ci: Add conventional title to gherkin update, error on missing asserts by @acoulton in #314
    • Assert that preg_split does not fail when splitting a table row by @stof in #337
    • Add assertions in the parser to reflect the structure of tokens by @stof in #342
    • style: Define and change phpdoc order coding style by @uuf6429 in #345
    Open source →
  6. v4.13.0 06 May 2025
    Release notes

    Changed

    • Files have been moved to flatten paths into a PSR-4 structure (instead of the previous PSR-0). This may affect users who are requiring files directly rather than using the composer autoloader as expected. See the 4.12.0 release for the new CachedArrayKeywords::withDefaultKeywords()to use thei18n.php` file without depending on paths to other files in this repo. By @uuf6429 in #288

    Added

    • ExampleTableNode now implements TaggedNodeInterface. Also refactored node tag handling methods. By @uuf6429 in #289
    • Improve some exceptions thrown when parsing invalid feature files. Also increased test coverage. By @uuf6429 in #295
    • New translations for amh (Amharic), be (Belarusian) and ml (Malayalam) from cucumber/gherkin in #306
    • Improved translations / whitespace for ga (Irish), it (Italian), ja (Japanese), ka (Georgian) and ko (Korean) from cucumber/gherkin in #306

    Internal

    • Fix & improve automatic CI updates to newer cucumber/gherkin test data and translations. By @acoulton in #300, #302, #304, #305
    • Update code style and resolve PHPStan warnings (up to level 9) in tests and CI scripts. By @uuf6429 in #296, #297 and #307
    • Make tests that expect exceptions more explicit by @uuf6429 in #310
    • Improve CI workflows and integrate Codecov reporting by @uuf6429 in #299 and #301
    • Refactor tag filtering implementation by @uuf6429 in #308
    • Update cucumber/gherkin parity tests to v32.1.1 in #306
    Open source →
    Release notes

    Changed

    • Files have been moved to flatten paths into a PSR-4 structure (instead of the previous PSR-0). This may affect users who are requiring files directly rather than using the composer autoloader as expected. See the 4.12.0 release for the new CachedArrayKeywords::withDefaultKeywords() to use the i18n.php file without depending on paths to other files in this repo. By @uuf6429 in #288

    Added

    • ExampleTableNode now implements TaggedNodeInterface. Also refactored node tag handling methods. By @uuf6429 in #289
    • Improve some exceptions thrown when parsing invalid feature files. Also increased test coverage. By @uuf6429 in #295
    • New translations for amh (Amharic), be (Belarusian) and ml (Malayalam) from cucumber/gherkin in #306
    • Improved translations / whitespace for ga (Irish), it (Italian), ja (Japanese), ka (Georgian) and ko (Korean) from cucumber/gherkin in #306

    Internal

    • Fix & improve automatic CI updates to newer cucumber/gherkin test data and translations. By @acoulton in #300, #302, #304, #305
    • Update code style and resolve PHPStan warnings (up to level 9) in tests and CI scripts. By @uuf6429 in #296, #297 and #307
    • Make tests that expect exceptions more explicit by @uuf6429 in #310
    • Improve CI workflows and integrate Codecov reporting by @uuf6429 in #299 and #301
    • Refactor tag filtering implementation by @uuf6429 in #308
    • Update cucumber/gherkin parity tests to v32.1.1 in #306
    Open source →
  7. v4.12.0 26 Feb 2025
    Release notes

    Changed

    • Gherkin::VERSION is deprecated and will not be updated, use the composer runtime API if you need to identify the running version. This also changes the value used to namespace cached feature files. by @acoulton in #279

    Added

    • Provide CachedArrayKeywords::withDefaultKeywords() to create an instance without an external dependency on the path to the i18n.php file in this repo. NOTE that paths to source files will change in the next Gherkin release - use the new constructor to avoid any impact. by @carlos-granados in #290

    Internal

    Open source →
    Release notes

    Changed

    • Gherkin::VERSION is deprecated and will not be updated, use the composer runtime API if you need to identify the running version. This also changes the value used to namespace cached feature files. by @acoulton in #279

    Added

    • Provide CachedArrayKeywords::withDefaultKeywords() to create an instance without an external dependency on the path to the i18n.php file in this repo. NOTE that paths to source files will change in the next Gherkin release - use the new constructor to avoid any impact. by @carlos-granados in #290

    Internal

    • Upgrade to phpunit 10 by @uuf6429 in #275
    • Remove redundant files by @uuf6429 in #278
    • Update documentation by @uuf6429 in #274
    • Adopt PHP CS Fixer and apply code styles by @uuf6429 in #277
    • Add PHPStan and improve / fix docblock annotations and type-safety within methods to achieve level 5 by @uuf6429 in #276, #281, #282, and #287
    Open source →
  8. v4.11.0 06 Dec 2024
    Release notes

    Changed

    • Drop support for PHP < 8.1, Symfony < 5.4 and Symfony 6.0 - 6.3. In future we will drop support for PHP and symfony
      versions as they reach EOL. by @acoulton in #272
    • Deprecated ExampleNode::getTitle() and ScenarioNode::getTitle() in favour of new methods with clearer meaning.
      by @uuf6429 in #271

    Added

    • Added (ExampleNode|ScenarioNode)::getName() to access human-readable names for examples and scenarios,
      and ExampleNode::getExampleText() for the string content of the example table row.
      by @uuf6429 in #271

    Internal

    • Enable dependabot for github actions workflows by @jrfnl in #261
    Open source →
    Release notes

    Changed

    • Drop support for PHP < 8.1, Symfony < 5.4 and Symfony 6.0 - 6.3. In future we will drop support for PHP and symfony versions as they reach EOL. by @acoulton in #272
    • Deprecated ExampleNode::getTitle() and ScenarioNode::getTitle() in favour of new methods with clearer meaning. by @uuf6429 in #271

    Added

    • Added (ExampleNode|ScenarioNode)::getName() to access human-readable names for examples and scenarios, and ExampleNode::getExampleText() for the string content of the example table row. by @uuf6429 in #271

    Internal

    • Enable dependabot for github actions workflows by @jrfnl in #261
    Open source →
  9. v4.10.0 19 Oct 2024
    Release notes

    Changed

    • ⚠ Backslashes in feature files must now be escaped
      Gherkin syntax treats \ as an escape character, which must be escaped (\\) to use it as a
      literal value. Historically, this was not being parsed correctly. This release fixes that bug,
      but means that if your scenarios currently use unescaped \ you will need to replace each one
      with \\ to achieve the same parsed result.
      By @everzet in 5a0836d.

    Added

    Fixed

    • Fix exception when filter string is empty thanks to @magikid in #251

    Internal

    • Sync teststuite with Cucumber 24.1.0
    • Fix PHPUnit 10 deprecation messages
    • A lot of great CI work by @heiglandreas and @jrfnl

    Note: 4.10.0 was actually released by @everzet on 2024-10-19, but just as a bare git tag - I've just marked it up as an official github release to avoid confusion,

    Open source →
  10. v4.9.0 12 Oct 2021
    Release notes

    What's Changed

    New Contributors

    Full Changelog: v4.8.0...v4.9.0

    Open source →
  11. v4.8.0 04 Feb 2021

    Nothing published for this version

  12. v4.7.3 04 Feb 2021

    Nothing published for this version

  13. v4.7.2 03 Feb 2021

    Nothing published for this version

  14. v4.7.1 26 Jan 2021

    Nothing published for this version

  15. v4.7.0 24 Jan 2021

    Nothing published for this version

  16. v4.6.2 17 Mar 2020

    Nothing published for this version

  17. v4.6.1 27 Feb 2020

    Nothing published for this version

  18. v4.6.0 16 Jan 2019

    Nothing published for this version

  19. v4.5.1 30 Aug 2017

    Nothing published for this version

  20. v4.5.0 30 Aug 2017

    Nothing published for this version

  21. v4.4.5 30 Oct 2016

    Nothing published for this version

  22. v4.4.4 18 Sep 2016

    Nothing published for this version

  23. v4.4.3 18 Sep 2016

    Nothing published for this version

  24. v4.4.2 03 Sep 2016

    Nothing published for this version

  25. v4.4.1 30 Dec 2015

    Nothing published for this version

  26. v4.4.0 29 Sep 2015

    Nothing published for this version

  27. v4.3.0 06 Jun 2014

    Nothing published for this version

  28. v4.2.1 06 Jun 2014

    Nothing published for this version

  29. v4.2.0 27 May 2014

    Nothing published for this version

  30. v4.1.3 25 May 2014

    Nothing published for this version

  31. v4.1.2 14 May 2014

    Nothing published for this version

  32. v4.1.1 05 May 2014

    Nothing published for this version

  33. v4.1.0 20 Apr 2014

    Nothing published for this version

  34. v4.0.0 05 Jan 2014

    Nothing published for this version

  35. v3.1.3 04 Jan 2014

    Nothing published for this version

  36. v3.1.2 01 Jan 2014

    Nothing published for this version

  37. v3.1.1 31 Dec 2013

    Nothing published for this version

  38. v3.1.0 31 Dec 2013

    Nothing published for this version

  39. v3.0.5 01 Jan 2014

    Nothing published for this version

  40. v3.0.4 31 Dec 2013

    Nothing published for this version

  41. v3.0.3 15 Sep 2013

    Nothing published for this version

  42. v3.0.2 14 Sep 2013

    Nothing published for this version

  43. v3.0.1 14 Sep 2013

    Nothing published for this version

  44. v3.0.0 14 Sep 2013

    Nothing published for this version

  45. v2.3.5 15 Oct 2013

    Nothing published for this version

  46. v2.3.4 11 Aug 2013

    Nothing published for this version

  47. v2.3.3 11 Aug 2013

    Nothing published for this version

  48. v2.3.2 11 Aug 2013

    Nothing published for this version

  49. v2.3.1 10 Aug 2013

    Nothing published for this version

  50. v2.3.0 04 Aug 2013

    Nothing published for this version

  51. v2.2.9 02 Mar 2013

    Nothing published for this version

  52. v2.2.8 02 Mar 2013

    Nothing published for this version

  53. v2.2.7 26 Jan 2013

    Nothing published for this version

  54. v2.2.6 26 Jan 2013

    Nothing published for this version

  55. v2.2.5 26 Sep 2012

    Nothing published for this version

  56. v2.2.4 03 Aug 2012

    Nothing published for this version

  57. v2.2.3 03 Aug 2012

    Nothing published for this version

  58. v2.2.2 01 Jul 2012

    Nothing published for this version

  59. v2.2.1 04 May 2012

    Nothing published for this version

  60. v2.2.0 03 May 2012

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive