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:
Christoph Michael Becker 2017-02-17 18:21:47 +00:00
parent fae36040d4
commit b896533ae5

View file

@ -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>