This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $x = 100; | |
| /* Jika nilai $x di bawah ini sama dengan variabel $x yang telah dideklarasikan | |
| maka akan mengeluarkan output false, begitu juga sebaliknya, Jika berbeda | |
| makan akan mengeluarkan output true*/ | |
| if ($x !== 90) { | |
| echo "Hello world!"; | |
| } | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $x = 100; | |
| $y = 50; | |
| // Salah satu variabel ada yang sama dengan variabel di atas yang telah di deklarasikan. | |
| if ($x == 100 || $y == 80) { | |
| var_dump($x == 100 || $y == 80); | |
| // Karena $x sama dengan variabel yang telah di deklarasikan maka percabangan if bernilai TRUE | |
| // Karena bernilai TRUE maka akan mengelurakan output di bawah ini |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $x = 100; | |
| $y = 50; | |
| // Salah satu variabel ada yang sama dengan variabel di atas yang telah di deklarasikan. | |
| if ($x == 100 && $y == 50) { | |
| // Karena $x sama dengan variabel yang telah di deklarasikan maka percabangan if bernilai TRUE | |
| var_dump($x == 100 && $y == 50); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $x = 100; | |
| $y = 50; | |
| // Akan bernilai true jika salah satunya true, tapi akan bernilai false jika keduanya true. | |
| if ($x == 100 xor $y == 80) { | |
| var_dump($x == 100 xor $y == 80); | |
| // Nilai percabangan di atas TRUE maka akan mengeluarkan output di bawah ini | |
| echo "Hello world!"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $x = 100; | |
| $y = 50; | |
| // Salah satu variabel ada yang sama dengan variabel di atas yang telah di deklarasikan. | |
| if ($x == 100 or $y == 80) { | |
| var_dump($x == 100 or $y == 80); | |
| // Karena $x sama dengan variabel yang telah di deklarasikan maka percabangan if bernilai TRUE | |
| // Karena bernilai TRUE maka akan mengelurakan output di bawah ini |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $x = 100; | |
| $y = 50; | |
| // Saat percabangan if nilai $x dan $y sesuai dengan $x dan $y yang sudah di deklarasikan di atas | |
| if ($x == 100 and $y == 50) { | |
| var_dump($x == 100 and $y == 50); | |
| // Karena di percabangan if di atas TRUE maka akan mengeluarkan output di bawah ini | |
| echo "Hello world!"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $x = 10; | |
| echo $x--; | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $x = 10; | |
| echo --$x; | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $x = 10; | |
| echo $x++; | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $x = 10; | |
| echo ++$x; | |
| ?> |