[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-117277":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":10,"pushedAt":33,"updatedAt":34,"readmeContent":35,"aiSummary":10,"trendingCount":16,"starSnapshotCount":16,"syncStatus":15,"lastSyncTime":36,"discoverSource":37},117277,"turbocov","shipmonk-rnd\u002Fturbocov","shipmonk-rnd","⚡ Coverage engine for PHP at near-native speed! 400× less overhead than Xdebug, 30× less than PCOV. ZERO overhead for code you do not measure (like vendor).","",null,"PHP",106,4,1,2,0,15,30,60,79.43,"MIT License",false,"master",[25,26,27,28,29,30,31,32],"code-coverage","pcov","performance","php","php-extension","phpunit","testing","xdebug","2026-11-21 21:01:57","2026-11-23 18:02:37","# turbocov – code coverage for PHP at near-native speed!\n\n- ⚡ **Ultrafast:** 400× less overhead than Xdebug, 30× less than PCOV\n- 🎯 **Focused:** Zero overhead for code you do not measure\n- 🍰 **Easy-to-use:** One `pie install`, one line in `phpunit.xml`\n- 🛡️ **Robust:** A broken setup stops the run with a clear message\n\n## Comparison\n\n![Time of the test suite of Carbon with each coverage driver](turbocov-performance.svg)\n\n\u003Csup>\u003Csub>Run the benchmark yourself: [benchmark\u002F](benchmark\u002FREADME.md)\u003C\u002Fsub>\u003C\u002Fsup>\n\nturbocov collects **line coverage only**, no branch or path coverage.\n\n### Precision\n\nturbocov is **more precise** than others for multi-line expressions.\nPCOV and Xdebug report [some lines](https:\u002F\u002Fgithub.com\u002Fshipmonk-rnd\u002Fturbocov\u002Fpull\u002F18) as covered even when PHP never executed them:\n\n```php\nreturn match ($a) {       \u002F\u002F assume $a = 1;\n    1 => 'one',\n    default => 'other',   \u002F\u002F PCOV and Xdebug: covered, turbocov: not covered\n};\n```\n\n## Installation\n\n```sh\npie install shipmonk\u002Fturbocov\ncomposer require --dev shipmonk\u002Fturbocov-phpunit\n```\n\n## Usage\n\nTell PHPUnit to use it:\n\n```xml\n\u003Ccoverage driver=\"ShipMonk\\Turbocov\\TurbocovDriver\"\u002F>\n```\n\n#### Full coverage\n\n```bash\nphp -d turbocov.collect_paths=src vendor\u002Fbin\u002Fphpunit --coverage-html coverage\n```\n\n#### PR-only coverage\n\nOnly want coverage for what your branch changed?\n\n```sh\ngit diff --name-only --diff-filter=AMR origin\u002Fmaster...HEAD -- '*.php' > changed.txt\nphp -d turbocov.collect_paths=@changed.txt vendor\u002Fbin\u002Fphpunit --coverage-clover clover.xml\n```\n\nExecution of unlisted files has **zero overhead**!\n\n\u003Csub>This is handy for [GitLab coverage visualization](https:\u002F\u002Fdocs.gitlab.com\u002Fci\u002Ftesting\u002Fcode_coverage\u002F#coverage-visualization) or [**Coverage Guard** rules in your CI](https:\u002F\u002Fgithub.com\u002Fshipmonk-rnd\u002Fcoverage-guard)\u003C\u002Fsub>\n\n## Requirements\n\n- PHP 8.4, 8.5 or 8.6\n- PHPUnit 13.3 or later. For older versions, see [Usage with older PHPUnit](#usage-with-older-phpunit).\n\n## Settings\n\n| Setting | Default | Description |\n|---|---|---|\n| `turbocov.enabled` | `1` | Set `0` to turn the extension off. It then has no effect at all. |\n| `turbocov.collect_paths` | none | The files and directories that get probes. |\n| `turbocov.exclude_paths` | none | The files and directories that get no probes. |\n| `turbocov.exclude_pattern` | none | A PCRE pattern. Files with a matching path get no probes. |\n\nThe two path settings take one of these values:\n\n- A list of paths with `:` separator: `src:config\u002Fservices.php`.\n- `@` and the name of a list file: `@changed.txt`. The list file has one path on each line.\n\nThe settings apply when PHP compiles a file. Set them in `php.ini` or with `-d`, not with `ini_set()`.\n\n## How it works\n\nPCOV and Xdebug do work for each instruction that PHP executes. turbocov does work only when a line runs for the first time.\n\n1. PHP compiles a file into opcodes. Each opcode has a pointer to its handler.\n2. For a whitelisted file, turbocov replaces the handler of the first opcode of each line with a probe.\n3. When a probe fires, it records the line and puts the original handler back. PHP then executes the same opcode again.\n4. From that moment the line runs without a probe.\n5. `stop()` arms the fired probes again. The cost of a test run is in proportion to the number of lines that the test touched.\n\nturbocov does not replace the instruction loop of PHP. Code without probes runs as if the extension is not loaded.\n\n### Slides\n- The later part of [these slides](https:\u002F\u002Fjanedbal.cz\u002Ftalks\u002Fslides\u002Fturbocov-coverage-guard\u002F) explains how the extension works more visually\n\n## API Functions\n\n```php\n\\turbocov\\ensure_can_collect();      \u002F\u002F throw \\turbocov\\CannotCollectException when the collection cannot work\n\\turbocov\\start();                   \u002F\u002F start the collection; throws the same exception\n\\turbocov\\stop();                    \u002F\u002F stop the collection; file => line => 1 for the lines that ran since start()\n\\turbocov\\get_executable_lines(      \u002F\u002F file => line => -1 for each executable line of the given files\n    ['\u002Fabsolute\u002Fpath\u002FFile.php'],\n);\n\\turbocov\\get_debug_info(            \u002F\u002F array of debug data like skip reason, executable lines and all probes\n    '\u002Fabsolute\u002Fpath\u002FFile.php',\n);\n```\n\n## Usage with older PHPUnit\n\n**The problem:** PHPUnit before 13.3 cannot load a custom coverage driver. It only knows PCOV and Xdebug.\n\n**The hacky solution:** install turbocov in a mode where it pretends to be PCOV. PHPUnit then uses it without any change. See [PCOV mode for older PHPUnit](docs\u002Fpcov-mode.md) for the steps.\n\n## Limitations\n\n- Not supported:\n    - Windows\n    - PHP-FPM and other web SAPIs\n- Not tested yet:\n    - macOS on Intel\n- Cannot run together with:\n    - Xdebug\n    - PCOV\n    - These settings (when `opcache.enable_cli=1`):\n      - `opcache.optimization_level` other than `0`\n      - `opcache.jit`\n      - `opcache.file_cache`\n      - `opcache.preload`\n      - `opcache.protect_memory=1`\n\n## Build from source\n\n```sh\nphpize\n.\u002Fconfigure --enable-turbocov\nmake\nmake test\n```\n\nLoad the result with `extension=\u002Fpath\u002Fto\u002Fmodules\u002Fturbocov.so`.\n\n## Development\n\nThe scripts in `dev\u002F` need Docker.\n\n```sh\nRUN_TESTS=1 dev\u002Fbuild.sh 8.5                 # build and run the tests\ndev\u002Fbuild.sh 8.5 pcov                        # build with the name pcov\ndev\u002Fcompare-with-pcov.sh 8.5 path\u002FFile.php   # check the line data against PCOV\ndev\u002Fbench.sh 8.5                             # compare the speed with plain PHP and PCOV\n```\n\n## License\n\nMIT. See [LICENSE](LICENSE).\n","2026-11-24 04:55:15","CREATED_QUERY"]