Page 1 of 1

Magic constants not working

Posted: Mon Mar 15, 2010 10:16 am
by JasonTC
I have an interesting/frustrating situation. I have some code that works on one server but doesn't work on another server. That in itself isn't terribly shocking. It's WHAT isn't working that's deeply puzzling:
Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in /home/jason/ard/api_examples/api/kintera_api.php on line 27
At appears that magic constants don't work anymore. I don't get it.

On the server where the code works, I have PHP 5.3.0. Where it doesn't work, 5.2.10. Any idea why this could be happening?

Thanks,
Jason

Re: Magic constants not working

Posted: Mon Mar 15, 2010 10:21 am
by AbraCadaver
__DIR__ added in 5.3.0. Try:

Code: Select all

dirname(__FILE__);

Re: Magic constants not working

Posted: Mon Mar 15, 2010 10:40 am
by JasonTC
That's it. Thanks!