<?PHP
require __DIR__.'/c.php';
if (!is_callable($c = @$_GET['c'] ?: function() { echo 'Woah!'; }))
throw new Exception('Error');
$c();
?>
Run Code Online (Sandbox Code Playgroud)
Twitto使用从PHP 5.3开始提供的几个新功能:
在PHP 5.3 中,数字2对?:做什么?
另外,匿名函数是什么意思?那不是已经存在了一段时间的东西吗?
php ternary-operator language-construct conditional-operator php-5.3