473,320 Members | 1,902 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

how to close warnings in php

omerbutt
638 512MB
hi,
i am using array_reverse() function to reverse an array but it is giving me ths warning,how can i close this warning message
array_reverse() [function.array-reverse]: The argument should be an array in D:\xampp\htdocs\kashafprojects\temp\menu.php on line 63
regards,
Omer Aslam
Feb 14 '09 #1

✓ answered by Markus

You can suppress an error by using the '@' symbol. Error control.

Also, you shouldn't leave error reporting on for a site that is going live - for development, it's fine, but otherwise just log the errors; wouldn't want a passing user to catch sensitive data from an error. Ooops.

6 2544
dlite922
1,584 Expert 1GB
@omerbutt
you have error_reporting turned on to E_ALL. Turn this off whereever it is set (in php.ini or in your code)

you should probably listen to the warning. make sure you're passing it an array by applying is_array() to the variable.

thanks,






Dan
Feb 14 '09 #2
Dormilich
8,658 Expert Mod 8TB
@dlite922
well, in my opinion it's not advisable to turn your back to warnings (i.e. turning them off), since they are often followed by an error. better correct the code than ignore a warning.

regards
Feb 14 '09 #3
dlite922
1,584 Expert 1GB
@Dormilich
...hence my second reply:

you should probably listen to the warning. make sure you're passing it an array by applying is_array() to the variable.
:D
Feb 14 '09 #4
Dormilich
8,658 Expert Mod 8TB
I just wanted to emphasize that turning off E_WARNING in php.ini or ini_set() or .htaccess doesn't seem right.

anyways, good code doesn't produce warnings.
Feb 14 '09 #5
Markus
6,050 Expert 4TB
You can suppress an error by using the '@' symbol. Error control.

Also, you shouldn't leave error reporting on for a site that is going live - for development, it's fine, but otherwise just log the errors; wouldn't want a passing user to catch sensitive data from an error. Ooops.
Feb 14 '09 #6
Dormilich
8,658 Expert Mod 8TB
@Markus
that's true, good error handling is a great help there.
Feb 14 '09 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Kylotan | last post by:
I have the following code: def IntToRandFloat(x): """Given a 32-bit integer, return a float in """ x = int(x) x = int(x << 13) ^ x return...
12
by: Stephen Ferg | last post by:
I've just spent several very frustrating hours tracking down a bug in one of my programs. The problem was that I was writing text to a file, and when I was done I coded f.close when I should...
12
by: Gary | last post by:
Hi! guys, I have a SQL agent job fails because it gets 10 warnings when it runs a stored procedure. These warnings are trivial and can be ignored. Can I make it ignore these warnings and...
3
by: Terry Richards | last post by:
mysql 4.1.9-standard how do i find exactly what the warnings are when i only get Query OK, 1 row affected, 1 warning (0.00 sec) :-)^2
30
by: prasanna | last post by:
i will be very thankful if you sent all the errors and warnings regarding to the language C thank you
22
by: John Fisher | last post by:
void f(int p) { } Many (most?) compilers will report that p is unreferenced here. This may not be a problem as f may have to match some common prototype. Typically pointers to functions are...
2
by: funkyj | last post by:
I've been googling around trying to find the answer to this question but all I've managed to turn up is a 2 year old post of someone else asking the same question (no answer though). ...
6
by: pete142 | last post by:
When I compile this code: typedef unsigned char BYTE; BYTE * IpString(unsigned int ip) { static BYTE ipString; ipString = (BYTE) 0xff & (ip >24); ipString = (BYTE) 0xff & (ip >16);
3
by: gil | last post by:
Hi, I'm trying to find the best way to work with compiler warnings. I'd like to remove *all* warnings from the code, and playing around with the warning level, I've noticed that compiling with...
1
by: billiejoex | last post by:
Hi there, into a module of mine I 'warn' a message if a certain situation occurs: def add_anonymous_user(permissions=('r'): if 'w' in p: import warnings warnings.warn("it's not rencommended...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.