Home > Backend Development > PHP Tutorial > 关于PHP内核的有关问题

关于PHP内核的有关问题

WBOY
Release: 2016-06-13 12:25:31
Original
775 people have browsed it

关于PHP内核的问题
$name = 'TIPI Team';
$func = function() use($name)
 {
    echo "Hello, $name";
 }
 
$func(); 
?>
按照PHP内核讲解手册中介绍的那样,应该会输出Hello TIPI Team
但我执行后,出现了如下的错误:

------解决思路----------------------
少了分号而已。

<br /><?php <br />$name = 'TIPI Team';<br />$func = function() use($name)<br /> {<br />    echo "Hello, $name";<br /> }; // 这里有个分号的。<br /> <br />$func(); <br />?><br />
Copy after login

Related labels:
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