Page 1 of 1

Warning: call to undefined php native function

Posted: Tue Apr 13, 2010 6:16 am
by GertjanFilarski
Hi there,
I am switching from .Net to PHP and the application I am working on runs fine. However I'd like to get rid of the more than 500 warnings I collected in Zend Studio ;)
Most of them say: "Call to undefined function 'define'" and relate to constants I use. I set these like:
define('PAGE_COMMAND_NONE', 0);
define('PAGE_COMMAND_SAVE', 1);
define('PAGE_COMMAND_EXECUTE', 2);
define('PAGE_COMMAND_DELETE', 3);
define('PAGE_COMMAND_EDIT', 4);
etc.

Afaik the 'define' function is part of PHP. Still each of these lines throws the warning. Googling got me a ton of information on Fatal Errors thrown by undefined user functions and none on Warnings for php native functions. So I am at a loss. Anyone care to shed some light on this? It may be incredibly obvious but I just don't see it :)

Cheers! Gertjan

Re: Warning: call to undefined php native function

Posted: Tue Apr 13, 2010 6:31 am
by roders
I've had the same problem i the only way i got rid of it was to add this at the start of my php page
error_reporting(E_ALL & ~E_NOTICE | E_STRICT);

Re: Warning: call to undefined php native function

Posted: Tue Apr 13, 2010 10:22 am
by AbraCadaver
This must be a bug in Zend Studio. If you turn on error reporting in your script and run it on the server without ZS, do you get a warning?

Re: Warning: call to undefined php native function

Posted: Fri Apr 16, 2010 3:18 am
by GertjanFilarski
Nope the warnings are only thrown within ZStudio. At the server everything runs fine.