Loading a class into a function ?

Posted by Adrian on Stack Overflow See other posts from Stack Overflow or by Adrian
Published on 2010-03-30T00:07:33Z Indexed on 2010/03/30 0:13 UTC
Read the original article Hit count: 902

Filed under:
|
|
|

I`m currently working on a script, and I have the following situation.

function somnicefunction()
{
    require 'someexternalclass.php';
    $somevar = new SomeExternalClass();
}

For some reason, the above breaks the function. I'm not sure why, I haven't seen much documentation in php.net regarding this, plus google returned no real results. Does anyone have any idea ?

© Stack Overflow or respective owner

Related posts about php

Related posts about class