private function fixSelfExecutingFunction($script)
    {
        if (preg_match('/^function[\s\(]/', $script)) {
            $script = preg_replace('/;$/', '', $script);
            $script = '(' . $script . ')';
        }

        return $script;
    }
private function fixSelfExecutingFunction($script)
    {
        if (preg_match('/^function[\s\(]/', $script)) {
            $script = preg_replace('/;$/', '', $script);
            $script = '(' . $script . ')';
        }

        return $script;
    }
private function fixSelfExecutingFunction ( $ script ) { if ( preg_match ( '/^function[\s\(]/' , $ script ) ) { $ script = preg_replace ( '/;$/' , '' , $ script ) ; $ script = '(' . $ script . ')' ; } return $ script ; }
Fixes self-executing functions to allow evaluating them.

The self-executing function must be wrapped in braces to work.

@param string $script

@return string
Fixes self - executing functions to allow evaluating them .