PHP中的宏 [英] Macros in php

查看:53
本文介绍了PHP中的宏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有希望新版本的PHP

会支持类似于C或C ++的宏?

我已经搜索了手册并且没有找到任何内容

除了define指令外,它可以用

来定义常量值。

当然它不是必需的功能,

但它可能非常有用。


greetz Emil

Is there any hope that new versions of PHP
will support macros similar to C or C++?
I''ve searched manual and didn''t find anything
except define directive, but it can be used
to define constant values only.
Of course it is not THAT neccessary functionality,
but it could be very useful.

greetz Emil

推荐答案

"埃米尔" < EM ************** @ podczta.onet.pl>在消息中写道

新闻:e1 ********** @ news.onet.pl ...
"Emil" <em**************@podczta.onet.pl> wrote in message
news:e1**********@news.onet.pl...
有没有希望新版本的PHP
会支持类似于C或C ++的宏吗?
我已经搜索过手册并且没有找到任何东西
除了define指令,但它可以用来定义常量只是值。
当然它不是必要的功能,
但它可能非常有用。
Is there any hope that new versions of PHP
will support macros similar to C or C++?
I''ve searched manual and didn''t find anything
except define directive, but it can be used
to define constant values only.
Of course it is not THAT neccessary functionality,
but it could be very useful.



函数和函数之间的实际差异是什么一个宏?如何使用

的宏与函数不同?


让我们假装有一种在php中定义宏的方法...

define(" MAX(


What''s the actual difference between a function and a macro? How would use
of macros differ from functions?

Let''s pretend there is a way of defining a macro in php...
define ("MAX(


a,


b)",(
b)", "((


这篇关于PHP中的宏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆