Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Strip whitespace (or other characters) from the beginning and end of a string
<?php trim(string $string, string $characters = " \n\r\t\v\x00"): string
<?php     private function contentify(string $data): string {

        if (trim($data) === '') {


            return $this->getContent();

        }
<?php     public function find(array $match): string {

        $splitted_conditional = explode(self::getTag(self::TAG_IF), $match['x']);

        $condition = trim($splitted_conditional[0]);

        $rendered_condition = $this->doOpreration($condition);

        $splitted_if_else = explode(self::getTag(self::TAG_ELSE), $splitted_conditional[1]);

        $ifTrue = trim($splitted_if_else[0] ?? '');
<?php         $condition = trim($splitted_conditional[0]);

        $rendered_condition = $this->doOpreration($condition);

        $splitted_if_else = explode(self::getTag(self::TAG_ELSE), $splitted_conditional[1]);

        $ifTrue = trim($splitted_if_else[0] ?? '');

        $ifFalse = trim($splitted_if_else[1] ?? '');

        return $this->getCore()->render($rendered_condition ? $ifTrue : $ifFalse);

    }
<?php         $rendered_condition = $this->doOpreration($condition);

        $splitted_if_else = explode(self::getTag(self::TAG_ELSE), $splitted_conditional[1]);

        $ifTrue = trim($splitted_if_else[0] ?? '');

        $ifFalse = trim($splitted_if_else[1] ?? '');

        return $this->getCore()->render($rendered_condition ? $ifTrue : $ifFalse);

    }
<?php         $operators = ['\={3}', '\={2}', '\!\={2}', '\!\={1}', '\<\=\>', '\>\=', '\<\=', '\<\>', '\>', '\<', '%', '&{2}', '\|{2}', 'xor', 'and', 'or'];

        if (preg_match('/.+\s*(' . implode('|', $operators) . ')\s*.+/U', $condition, $matches)) {

            $a_and_b = explode($matches[1], $condition);

            $a = trim($this->getCore()->render($a_and_b[0]));

            $b = trim($this->getCore()->render($a_and_b[1]));

            return self::evaluateOperation($a, $matches[1], $b);

        }
<?php         if (preg_match('/.+\s*(' . implode('|', $operators) . ')\s*.+/U', $condition, $matches)) {

            $a_and_b = explode($matches[1], $condition);

            $a = trim($this->getCore()->render($a_and_b[0]));

            $b = trim($this->getCore()->render($a_and_b[1]));

            return self::evaluateOperation($a, $matches[1], $b);

        }

        return $this->getCore()->render($condition);