mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Fix #74098: Misleading information on static function calls.
A feature that is available as of PHP 5.4.0 should not be exemplified by code requiring a newer version, even though the example would be less verbose. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@341922 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
fae36040d4
commit
b896533ae5
1 changed files with 13 additions and 6 deletions
|
@ -1568,14 +1568,18 @@ NULL]]>
|
|||
<![CDATA[
|
||||
<?php
|
||||
|
||||
new class {
|
||||
class Foo
|
||||
{
|
||||
function __construct()
|
||||
{
|
||||
(static function() {
|
||||
$func = static function() {
|
||||
var_dump($this);
|
||||
})();
|
||||
};
|
||||
$func();
|
||||
}
|
||||
};
|
||||
new Foo();
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
@ -1596,16 +1600,19 @@ NULL
|
|||
<![CDATA[
|
||||
<?php
|
||||
|
||||
(static function() {
|
||||
$func = static function() {
|
||||
// function body
|
||||
})->call(new StdClass);
|
||||
};
|
||||
$func = $func->bindTo(new StdClass);
|
||||
$func();
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Warning: Cannot bind an instance to a static closure in /in/sLLS9 on line 5
|
||||
Warning: Cannot bind an instance to a static closure in %s on line %d
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
|
Loading…
Reference in a new issue