1
0
mirror of https://github.com/php/doc-tr.git synced 2026-03-24 15:22:23 +01:00
Files
archived-doc-tr/reference/errorfunc/functions/get-error-handler.xml

120 lines
3.1 KiB
XML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 99916949eb29e72ffa97be78170e2439db69dae9 Maintainer: lacatoire Status: ready -->
<refentry xml:id="function.get-error-handler" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>get_error_handler</refname>
<refpurpose>Kullanıcı tanımlı hata işleyici işlevi döndürür</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type class="union"><type>callable</type><type>null</type></type><methodname>get_error_handler</methodname>
<void/>
</methodsynopsis>
<simpara>
Varsa, geçerli hata işleyici işlevini döndürür.
</simpara>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<simpara>
Tanımlanmışsa, geçerli hata işleyiciyi döndürür.
Yerleşik hata işleyici kullanılıyorsa &null; döndürülür.
</simpara>
<simpara>
Döndürülen işleyici, tanımlamak için
<function>set_error_handler</function> işlevine iletilen
çağrılabilir değerin tam karşılığıdır.
</simpara>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>get_error_handler</function> örneği</title>
<programlisting role="php">
<![CDATA[
<?php
$handler = function (int $errno, string $errstr, ?string $errfile, ?int $errline) {
echo "Error: " . $errstr . "\n";
};
var_dump(get_error_handler()); // NULL
set_error_handler($handler);
var_dump(get_error_handler() === $handler); // bool(true)
?>
]]>
</programlisting>
</example>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<tip>
<simpara>
PHP 8.5.0 öncesinde bu işlevsellik aşağıdaki çokdoldurum ile
sağlanabilir:
</simpara>
<informalexample>
<programlisting role="php">
<![CDATA[
<?php
if (!function_exists('get_error_handler')) {
function noop_error_handler() {
}
function get_error_handler(): ?callable {
$handler = set_error_handler('noop_error_handler');
restore_error_handler();
return $handler;
}
}
?>
]]>
</programlisting>
</informalexample>
</tip>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><function>error_reporting</function></member>
<member><function>set_error_handler</function></member>
<member><function>restore_error_handler</function></member>
<member><function>trigger_error</function></member>
<member><link linkend="errorfunc.constants">error level constants</link></member>
</simplelist>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->