Try Rector
Docs
Hire Team
Find Rule
Blog
Contact
AST
Try Rector
Docs
Hire Team
Find Rule
Blog
Contact
AST
Run Rector on your code to see what it can do for you:
// no change
PHP snippet to change
<?php namespace App; declare(ticks=1) { echo 'test'; throw new Exception(); echo 'unreachable'; }
Config
rector.php
<?php declare(strict_types=1); use Rector\Config\RectorConfig; use Rector\DeadCode\Rector\Stmt\RemoveUnreachableStatementRector; return RectorConfig::configure() ->withRules([RemoveUnreachableStatementRector::class]);
Run Rector
Rector version:
f8c758
- released at 2026-01-01 17:22