Home >Backend Development >PHP Tutorial >Several special operators in PHP

Several special operators in PHP

WBOY
WBOYOriginal
2016-07-29 08:59:53916browse
// 错误屏蔽 ( @ )
$err2 = @(5 / 0);

//  执行(`.....`)
//  反引号可以把反引号之间的字符串当做shell命令执行,并返回输出结果
//  反引号运算符“`”的效果与函数 shell_exec() 相同
$listing = `ipconfig`;
echo  $listing;

//  类型 (instanceof)
//  测试一个变量是否为给定类的实例化的对象,或是一个接口的实现
class AA{}
$a = new AA;
if($a instanceof AA){
    echo '$a is Class "AA"';
}
if($a instanceof BB){
    echo '$a is Class "BB"';
}

The above has introduced several special operators in PHP, including related content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
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