php中define带入表达式问题

WBOY
Release: 2016-06-02 11:34:03
Original
952 people have browsed it

php

<code>define('GW_MAXFILESIZE', '32768*10');echo GW_MAXFILESIZE/1;</code>
Copy after login

为什么输出是32768而不是327680呢?
读书少……

一个猜想,php不像C是原样替换,先发生了类型转换,遇到「*」号就直接忽略后面的了。

若如此,那么
define('GW_MAXFILESIZE', '32768*10');
if(GW_MAXFILESIZE>0) {
//whatever
}

又如何处理常量呢?

谢谢

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!