Welcome Guest, Not a member yet? Register   Sign In
" Undefined variable" message when I am trying to create custom library.
#4

[eluser]PhilTem[/eluser]
[quote author="Aken" date="1344401939"]There's also zero reason for you to extend the CI_Loader library if you're creating your own new library.[/quote]

First of all, Aken is totally right. You don't extend any class if you create a custom library.

Second: You should always initialize all variables before you first access them. CI has set error_reporting to E_ALL when in development-environment. That way, it will create errors when you access a variable that was not initialized by you prior to accessing it.
In other words:

Code:
$codelenght = $n;
$newcode_length = 0;
  while($newcode_length < $codelenght) {
...

PS: This is not an issue with CI, it's an issue with good coding style since every script should give you this error when error_reporting == E_ALL and you do something like accessing a variable before it's initialized Wink


Messages In This Thread
" Undefined variable" message when I am trying to create custom library. - by El Forum - 08-08-2012, 09:40 AM



Theme © iAndrew 2016 - Forum software by © MyBB