Allow PHP in WordPress Text Widgets

<?php
function php_text($text) {
if (strpos($text, '<' . '?') !== false) {
ob_start();
eval('?' . '>' . $text);
$text = ob_get_contents();
ob_end_clean();
}
return $text;
}
add_filter('widget_text', 'php_text', 99);

Source