Skip to content

Instantly share code, notes, and snippets.

@mcsee
Last active February 29, 2024 13:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcsee/b6df5d98efbecc9be783006d364e63f8 to your computer and use it in GitHub Desktop.
Save mcsee/b6df5d98efbecc9be783006d364e63f8 to your computer and use it in GitHub Desktop.
<?
class WordProcessor {
function replaceText(string $patternToFind, string $textToReplace) {
$this->text = '<<<' .
str_replace($patternToFind, $textToReplace, $this->text)
. '>>>';
}
}
final class Obfuscator {
function obfuscate(string $patternToFind, string $textToReplace) {
$this->text =
strlower(str_ireplace(
$patternToFind, $textToReplace, $this->text));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment