1
0
mirror of https://github.com/php/doc-tr.git synced 2026-03-24 07:12:18 +01:00
Files
archived-doc-tr/language/operators/logical.xml
Sergey Panteleev fa3a1a7ec0 Sync with English
2024-05-31 17:38:57 +03:00

132 lines
3.6 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: 43d07782b514d0c7a8487f2c74063739f302df8d Maintainer: nilgun Status: ready -->
<sect1 xml:id="language.operators.logical">
<title>Mantıksal İşleçler</title>
<titleabbrev>Mantıksal</titleabbrev>
<table>
<title>Mantıksal İşleçler</title>
<tgroup cols="3">
<thead>
<row>
<entry>Örnek</entry>
<entry>İsim</entry>
<entry>Sonuç</entry>
</row>
</thead>
<tbody>
<row>
<entry><userinput>$a and $b</userinput></entry>
<entry>Ve</entry>
<entry><varname>$a</varname> ve <varname>$b</varname> her ikisi de
doğruysa sonuç doğrudur (&true;).</entry>
</row>
<row>
<entry><userinput>$a or $b</userinput></entry>
<entry>Veya</entry>
<entry><varname>$a</varname> veya <varname>$b</varname> doğruysa sonuç
doğrudur.</entry>
</row>
<row>
<entry><userinput>$a xor $b</userinput></entry>
<entry>Ayrıcalıklı Veya</entry>
<entry><varname>$a</varname> veya <varname>$b</varname> doğruysa sonuç
doğru, her ikiside doğruysa sonuç yanlıştır (&false;).</entry>
</row>
<row>
<entry><userinput>! $a</userinput></entry>
<entry>Değil</entry>
<entry><varname>$a</varname> doğru değilse sonuç doğrudur.</entry>
</row>
<row>
<entry><userinput>$a &amp;&amp; $b</userinput></entry>
<entry>Ve</entry>
<entry><varname>$a</varname> ve <varname>$b</varname> her ikisi de
doğruysa sonuç doğrudur.</entry>
</row>
<row>
<entry><userinput>$a || $b</userinput></entry>
<entry>Veya</entry>
<entry><varname>$a</varname> veya <varname>$b</varname> doğruysa sonuç
doğrudur.</entry>
</row>
</tbody>
</tgroup>
</table>
<simpara>
Ve, Veya işleçlerinin iki farklı türü olmasının sebebi önceliklerinin
farklı oluşudur. (Bakınız: <link linkend="language.operators.precedence"
>İşleç Önceliği</link>.)
</simpara>
<example>
<title>- Örneklerle mantıksal işleçler</title>
<programlisting role="php">
<![CDATA[
<?php
// --------------------
// Aşağıdaki ifadelerde ilk terim sonucu belirlediğinden ikinci
// terime hiç bakılmayacak, yani foo() işlevi hiç çağrılmayacaktır.
$a = (false && foo());
$b = (true || foo());
$c = (false and foo());
$d = (true or foo());
// --------------------
// "||" işlecinin önceliği "or" işlecinden yüksektir.
// İfadenin sonucu $e'ye atanır (false || true)
// Tıpkı şöyle: ($e = (false || true))
$e = false || true;
// "or" işleminden önce false sabiti $f'ye atanır ve true yoksayılır
// Tıpkı böyle: (($f = false) or true)
$f = false or true;
var_dump($e, $f);
// --------------------
// "&&" işlecinin önceliği "and" işlecinden yüksektir.
// İfadenin sonucu $g'ye atanır (true && false)
// Tıpkı böyle: ($g = (true && false))
$g = true && false;
// "and" işleminden önce true sabiti $h'ya atanır ve false yoksayılır
// Tıpkı böyle: (($h = true) and false)
$h = true and false;
var_dump($g, $h);
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
bool(true)
bool(false)
bool(false)
bool(true)
]]>
</screen>
</example>
</sect1>
<!-- 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
-->