PHP操作顺序 [英] PHP Order of operations

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

问题描述

我想知道PHP如何执行此操作.操作顺序

I wanted to know how PHP would execute this. Order of operations

addslashes(strip_tags($record['value']));

是首位还是strip_tags的加号?

Is addslashes called first or strip_tags?

换句话说,它是从内而外还是从外而内执行?

In other words, does it execute from the inside out or from the outside in?

推荐答案

由内而外.

在PHP中传递到函数中的东西称为表达式".当您将表达式作为参数传递时,您真正传递的是该表达式的值.为此,在传递表达式之前先对其求值.

The things passed into a function in PHP are called "expressions". When you pass an expression as a parameter, what you're really passing is the value of that expression. In order to do that, the expression is evaluated before it is passed in.

php手册中有关表达式的更多信息.

More about expressions from the php manual.

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

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