It should be noted that the function_exists check is not relative to the root namespace. This means that the namespace should be appended to the check:
<?php
namespace test;
if (!function_exists(__NAMESPACE__ . '\example'))
{
function example()
{
}
}
?>