Warning: call to undefined php native function

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
GertjanFilarski
Forum Newbie
Posts: 2
Joined: Tue Apr 13, 2010 6:01 am

Warning: call to undefined php native function

Post 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
roders
Forum Commoner
Posts: 68
Joined: Tue Oct 20, 2009 9:29 am

Re: Warning: call to undefined php native function

Post 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);
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: Warning: call to undefined php native function

Post 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?
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
GertjanFilarski
Forum Newbie
Posts: 2
Joined: Tue Apr 13, 2010 6:01 am

Re: Warning: call to undefined php native function

Post by GertjanFilarski »

Nope the warnings are only thrown within ZStudio. At the server everything runs fine.
Post Reply