3v4l.org

run code in 300+ PHP versions simultaneously
<?php $inputs = [ 'בְּרֵאשִׁית בָּרָא אֱלֹהִים אֵת הַשָּׁמַיִם וְאֵת הָאָֽרֶץ', 'בְּרֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָֽרֶץ', ]; foreach ($inputs as $input) { $output = preg_replace('/[\x{0591}-\x{05AF}\x{05BE}\x{05C0}\x{05C3}]+/u', '', $input, -1, $count); echo !$count ? "no change" : "Replacement Count: {$count}\nBefore: {$input}\n After: {$output}"; echo "\n---\n"; }

preferences:
152.78 ms | 404 KiB | 5 Q