Try Rector
Docs
Hire Team
Find Rule
Blog
Contact
AST
Try Rector
Docs
Hire Team
Find Rule
Blog
Contact
AST
Rector run Failed:
{ "totals": { "changed_files": 0, "errors": 1 }, "errors": [ { "message": "System error: \"Syntax error, unexpected T_STRING, expecting ')' on line 1\"\nRun Rector with \"--debug\" option and post the report here: https://github.com/rectorphp/rector/issues/new", "file": "/var/www/storage/demo/qg6dc18ss8rzxr17cqva/rector_analyzed_file.php", "line": 319 } ] }
Run Rector on your code to see what it can do for you:
PHP snippet to change
<?php $result = preg_replace('/%u([a-f0-9]{4,4})/ei', 'utf8_chr(0x$1)', $_REQUEST['content']); function utf8_chr($num) { return '?'; }
Config
rector.php
<?php declare(strict_types=1); use Rector\Config\RectorConfig; use Rector\Php55\Rector\FuncCall\PregReplaceEModifierRector; return RectorConfig::configure() ->withRules([PregReplaceEModifierRector::class]);
Run Rector
Rector version:
730c31
- released at 2026-02-15 20:32