[eluser]CroNiX[/eluser]
I just did that, and it gave a fatal error as expected.
Repeatable steps I took:
1) Downloaded fresh CI 2.2 from this site and unzipped in /public_html/CI2_test. Nothing was altered except what is mentioned below. There is no .htaccess and all settings are the default settings.
2) Went to http://localhost/CI2_test in a browser and saw the default CI "welcome" message
3) Created /application/helpers/MY_url_helper.php
Code:
if ( ! function_exists('test_url'))
{
function test_url()
{
echo 'this is test_url from MY_url_helper';
}
}
4) changed default controller, /application/controllers/welcome.php, and called the new helper function WITHOUT loading the url helper first. There is nothing autoloaded, either. This is a stock CI install.
Code:
class Welcome extends CI_Controller {
public function index()
{
test_url();
}
}
5) In browser, went to http://localhost/CI2_test and got the expected error:
Code:
Fatal error: Call to undefined function test_url() in /public_html/CI2_test/application/controllers/welcome.php on line 8
6) Changed /application/controllers/welcome.php and loaded the url helper before the new function call
Code:
class Welcome extends CI_Controller {
public function index()
{
$this->load->helper('url');
test_url();
}
}
7) In browser, went to http://localhost/CI2_test and got the expected result:
Code:
this is test_url from MY_url_helper
So, it is not doing what you stated and works as intended.