PHP-Operatoren "??" und "?:" liefern unterschiedliche Ergebnisse

Warum liefert "??" anderes Ergebnis als "?:", wenn man sonst identische Werte hat ? Getestet habe ich mit PHP 7.1.4

<?php

$var1 = 0 ?? 123;

$var2 = 0 ?: 123;

echo " $var1 : $var2 ";

// Ergebnis ist 0 : 123

?>

Neuen Kommentar schreiben

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.

Suche

Neueste Kommentare