Skip to content

Commit

Permalink
sync with en rev
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardolara committed Dec 9, 2024
1 parent ada3e93 commit d0d9e51
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions reference/var/functions/is-callable.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 6834bf7ae4817a818a726529f6055ade2ae2bf1c Maintainer: leonardolara Status: ready -->
<!-- EN-Revision: 32c55286c8739fd20de9c8624473b2f3268de68e Maintainer: leonardolara Status: ready -->
<refentry xml:id="function.is-callable" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>is_callable</refname>
Expand Down Expand Up @@ -133,8 +133,11 @@ string(21) "SomeClass::someMethod"
<example>
<title>Exemplo de <function>is_callable</function> e contrutores</title>
<simpara>
<function>is_callable</function> reporta construtores como métodos
que não podem ser chamados.
Apesar do fato que construtores são métodos que são chamados quando
um objeto é criado, eles não são métodos estáticos e
<function>is_callable</function> retornará &false; para eles. Não é
possível usar <function>is_callable</function> para verificar se uma classe pode
ser instanciada a partir do escopo atual.
</simpara>
<programlisting role="php">
<![CDATA[
Expand All @@ -152,6 +155,9 @@ var_dump(
is_callable(['Foo', 'foo'])
);
$foo = new Foo();
var_dump(is_callable([$foo, '__construct']));
?>
]]>
</programlisting>
Expand All @@ -160,6 +166,7 @@ var_dump(
<![CDATA[
bool(false)
bool(false)
bool(true)
]]>
</screen>
</example>
Expand Down

0 comments on commit d0d9e51

Please sign in to comment.