Home > Backend Development > PHP Tutorial > php常量的问题。php常量的值改变了,疑惑

php常量的问题。php常量的值改变了,疑惑

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-02 11:34:30
Original
1067 people have browsed it

php

php常量的问题。php常量的值不能改变,但是一下这段代码的值有一点改变。请大家帮我分析一下。
代码如下:
define("CONSTANT", "hello!", true);
echo CONSTANT."
";
define("CONSTANT", "What are you doing?");
echo CONSTANT."
";
echo Constant;
页面输出时这样的:
hello!
What are you doing?
hello!

搞不清楚为什么第二个会输出"What are you doing?". define第一个时不设置true的话输出的是“hello”。大家有什么见解吗?

Related labels:
php
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template