CKTIS / PHP
Congiunzione logica (and)
La parola `and` richiede due operandi veri e salta il destro se il sinistro è falso.
Versione: PHP 8.4; repository runtime, production runtime not attested
Sintassi
($first and $second)La parola and richiede due operandi veri e salta il destro se il sinistro è falso. Ha precedenza inferiore all’assegnazione. Senza parentesi la variabile può ricevere l’operando sinistro anche se l’intera espressione è falsa. Con le parentesi si memorizza il risultato dei due test.
($first and $second)
[true,false]
Esempi
<?php
$first = true and false;
$whole = (true and false);
echo json_encode([$first,$whole]);
Risultato
[true,false]