PHP: seltener "goes to" Operator ( - - > )
30. Dezember 2009
PHP hat einen "goes to"-Operator. Die Integer-Variable $x geht dabei schrittweise Richtung Null. Beispiel:
<?php
$x = 10 ;
while ( $x --> 0 ) {
echo $x . ' ' ;
}
?>
Ausgabe:
9 8 7 6 5 4 3 2 1 0
Sensationell. Im PHP-Manual wird dieser Operator nicht erwähnt. Warum? Weil es in Wirklichkeit zwei Operatoren sind. Geparst wird das ganze nämlich so:
<?php
$x = 10 ;
while ( $x-- > 0 ) {
echo $x . ' ' ;
}
?>
Und jetzt ist die Bedingung in der While-Schleife ein ganz normaler Post-Dekrement gefolgt von einem Vergleich. Das Ganze funktioniert also nur in die absteigende Richtung. Für die andere Richtung müsste man ++< schreiben - sieht dann aber nicht mehr so schick aus.
Kommentare
20.08.2021 22:50
ivermectin 0.5% - ivermectin 1 cream generic ivermectin generic name
20.04.2024 11:30
https://www.mazafakas.com/user/profile/3955649
http://drahthaar-forum.ru/topic9211.html?view=print
Купить аттестат о среднем – путь для вашему перспективам. В нашем сервисе все вы можете легко и быстро купить свидетельство, необходимый для дальнейшего получения образования или трудоустройства. Наши специалисты гарантируют высокое качество и конфиденциальность услуги. Покупайте образовательный аттестат здесь и проявите новые перспективы для того, чтобы вашего образования и карьеры.
31.10.2021 04:54
cialis generic cialis support 365
25.11.2021 21:51
https://cialiswithdapoxetine.com/ cialis generic
30.04.2022 02:31
izleyicileri Twitch
30.04.2022 10:24
ed clinics
05.06.2022 22:49
mqxmq
fpgrn
t59o
10.06.2022 00:22
ujpl5
mi3dw
sy1b
14.06.2022 08:57
zanaflex myasthenia gravis prescription drug tizanidine zanaflex makes you feel cold how to discontinue taking zanaflex
14.06.2022 09:30
priligy fda approved order priligy online dapoxetine clinicak trials on usa how much dapoxetine to take for sex
Schreibe einen Kommentar!