473,779 Members | 2,023 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reporting undefined variables

Hello, Ia m running PHP 4 on Fedora Linus Apache 1.27. Since I have a
dev box, I would like warnings to appear in the event of undefined
variables or constants. But although I specified this setting in the
php.ini file,

;error_reportin g = E_COMPILE_ERROR |E_ERROR|E_CORE _ERROR
;
; - Show all errors except for notices
;
error_reporting = E_ALL

; Print out errors (as a part of the output). For production web
sites,
; you're strongly encouraged to turn this feature off, and use error
logging
; instead (see below). Keeping display_errors enabled on a production
web site
; may reveal security information to end users, such as file paths on
your Web
; server, your database schema or other information.
display_errors = On
warnings are not displayed. I stopped and restarted Apache. How can
I verify at runtime the error reporting level? Is there some kind of
PHP printable command?

DOes anyone have any other suggestions for how I may display undefined
variable warnings?

Much thanks, - Dave
Jul 17 '05 #1
1 1706
On Thu, 29 Jul 2004 20:41:44 -0700, D. Alvarado wrote:
Hello, Ia m running PHP 4 on Fedora Linus Apache 1.27. Since I have a
dev box, I would like warnings to appear in the event of undefined
variables or constants. But although I specified this setting in the
php.ini file,

;error_reportin g = E_COMPILE_ERROR |E_ERROR|E_CORE _ERROR
;
; - Show all errors except for notices
;
error_reporting = E_ALL
[ snip ]

warnings are not displayed. I stopped and restarted Apache. How can
I verify at runtime the error reporting level? Is there some kind of
PHP printable command?

DOes anyone have any other suggestions for how I may display undefined
variable warnings?

Much thanks, - Dave

Dave, try:
error_reporting = E_ALL & E_NOTICE
Note: Enabling E_NOTICE during development has some benefits. For
debugging purposes: NOTICE messages will warn you about possible bugs in
your code. For example, use of unassigned values is warned. It is
extremely useful to find typos and to save time for debugging. NOTICE
messages will warn you about bad style. For example, $arr[item] is better
to be written as $arr['item'] since PHP tries to treat "item" as constant.
If it is not a constant, PHP assumes it is a string index for the array.

Sounds about right if I understand you correctly =)
HTH.

Regards,

Ian

--
Ian.H
digiServ Network
London, UK
http://digiserv.net/

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2052
by: Digital Puer | last post by:
Hi, I'm a newbie coming from JSP (and also a lifetime of C/C++/Java), and I was wondering if someone could help me with the following questions. 1. Does PHP have a way to display an expression or variable without using echo? I'm particularly looking for JSP's <%= %> operator that will allow me to embed a variable right into HTML. 2. About error reporting, I've found that the default error reporting level doesn't report undefined...
1
2423
by: Oliver Spiesshofer | last post by:
Hi, I have set in my .htaccess file php_flag error_reporting 2047 to prevent error output to users. However, in some selected scripts I want to allow errors to be shown. I tried several things but I never get the combination done.
0
1863
by: Dave | last post by:
Hi everyone, (I already posted this to the VS.NET IDE news group without any responses, so I'm attempting one more time in this group) The issue I'm having is occuring in the IDE of VS.NET 2003, although I'm not sure what is actually causing the problem. I can't summarize the issue, so please read on to find out more. I've created a BaseDialogEditor class that allows a developer (namely me) to create Modal editors for controls at...
10
5502
by: PCHOME | last post by:
Hi! Would someone please help me thess C error(in gcc on Linux)? The compiler continues to give me: readLP.o: In function `Input_Problem': readLP.o(.text+0x0): multiple definition of `Input_Problem' main.o(.text+0x2f2): first defined here /usr/bin/ld: Warning: size of symbol `Input_Problem' changed from 172 to 185 in
49
14529
by: matty | last post by:
Hi, I recently got very confused (well that's my life) about the "undefined" value. I looked in the FAQ and didn't see anything about it. On http://www.webreference.com/programming/javascript/gr/column9/ they say: <snip> The undefined property A relatively recent addition to JavaScript is the undefined property.
17
3351
by: yb | last post by:
Hi, Looking for clarification of undefined variables vs. error in JavaScript code. e.g. <script> alert( z ); // this will be an error, i.e. an exception </script>
6
6080
by: tshad | last post by:
I have a structure (which happens to be a Java DataBean that contains some string arrays) that is giving me an error. The error at the "for" statement is: Object reference not set to an instance of an object. Here is the code where chDataBean is the structure. chDataBean.voucherNumber is a string array of voucher numbers. But if there are no numbers the debugger shows it as <undefined value>. But other fields
45
4861
by: VK | last post by:
(see the post by ASM in the original thread; can be seen at <http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/3716384d8bfa1b0b> as an option) As that is not in relevance to "new Array() vs " question or to the array performance, I dared to move it to a new thread. Gecko takes undefined value strictly as per Book 4, Chapter 3, Song 9 of Books of ECMA :-)
3
2309
by: Brian A | last post by:
I have written some Javascript that works perfectly in Firefox - no errors reported. The dreaded MSIE 6 produces nothing but a long line of 'undefinedundefinedundefinedundefinedundefined ....' Each 'undefined' represents a text node or element I have interted into the DOM. As far as I can see I have declared all variables and asigned values so I just can't see what is wrong. Unfortunately the error reporting in MSIE is very poor indeed....
0
9471
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10302
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10136
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10071
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9925
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8958
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3631
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2867
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.