3v4l.org

run code in 300+ PHP versions simultaneously
<?php // French // Result: 1À 2 3Ä 4Æ // Expect: 11 22 33 44 echo preg_replace(['/à/iu', '/â/iu', '/ä/iu', '/æ/iu'], ['1', '2', '3', '4'], 'àÀ â äÄ æÆ') . PHP_EOL; // Result: à1 â2 ä3 æ4 // Expect: 11 22 33 44 echo preg_replace(['/À/iu', '/Â/iu', '/Ä/iu', '/Æ/iu'], ['1', '2', '3', '4'], 'àÀ â äÄ æÆ') . PHP_EOL; // Russian // Result: 1Ё 2Й // Expect: 11 22 echo preg_replace(['/ё/iu', '/й/iu'], ['1', '2'], 'ёЁ йЙ') . PHP_EOL; // Result: ё1 й2 // Expect: 11 22 echo preg_replace(['/Ё/iu', '/Й/iu'], ['1', '2'], 'ёЁ йЙ') . PHP_EOL;
based on H7q5a
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.23, 7.4.0 - 7.4.12, 8.0.0
11 22 33 44 11 22 33 44 11 22 11 22