Home > Backend Development > PHP Tutorial > Regarding warnings in the language (including notices in PHP), warningnotice_PHP tutorial

Regarding warnings in the language (including notices in PHP), warningnotice_PHP tutorial

WBOY
Release: 2016-07-13 10:15:57
Original
1025 people have browsed it

Regarding warnings in languages ​​(including notices in PHP), warningnotice

PHP’s notice

Today I am using PHP to write a file reading and writing problem. Intercepting the data inside will cause notice, as follows, (does not affect the operation). Since I have never made a PHP product within the company, I don’t know what the requirements for notice are? So I went to Baidu GOOGLE to find answers, all of which dealt with various notices.

Discussed with other PHP technical staff, there are different ways to deal with it: some said to deal with all; some said to @ directly; some said to directly change the reporting error level.

C++ warning

At the same time, I thought of the following warnings in C++ programs. The small module warnings written before are all processed. Now the company does not require the warning to be processed, so it does not process it. After all, does it take time?

Summary

When I write a program, I don’t like to see warnings or notices, so I will handle them. In a company that does not require handling, sometimes it is not handled because of depravity. Sometimes this kind of warning is someone else’s program. within.

How did you deal with it?

Notice problem in php

I don’t know how you changed your php.ini. . Or rather. . Have you corrected the file (don’t be sure too quickly, I often see many people correcting the wrong file)

If it really doesn’t work. You write this on the first line of each file or common file in your code

error_reporting(E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE);

Question for PHP newbies: If you use the database, the website will have a lot of warnings and notices

Question 1: Just a reminder that the mysql_pcconect() function will be removed in future PHP versions. Please use mysqli or pdo instead.
Question 2: The rs_admin variable in line 139 of the code is not defined. This is for you. Check it yourself
Problem 3: Due to problem 2, the parameter of your mysql_free_result() is null. If you solve problem 2, there will be no problem here

If you just want to hide the problem (not recommended) ):
Add at the beginning of your php file:
ini_set('display_errors',"1");

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/900987.htmlTechArticle Regarding warnings in languages ​​(including notices in PHP), warningnotice PHP notices are written in PHP today. There is a problem with reading and writing a file. There will be a notice when intercepting the data inside, as follows: (...
Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template