⊗ppPmCdBN 86 of 447 menu

Nuances of Shorthand Operations in PHP

Note that in shorthand operations, comparison is performed using ==, not ===.

Without running the code, determine what will be displayed on the screen:

<?php $test = 3; if ($test) { echo '+++'; } else { echo '---'; } ?>

Without running the code, determine what will be displayed on the screen:

<?php $test = 'abc'; if ($test) { echo '+++'; } else { echo '---'; } ?>

Without running the code, determine what will be displayed on the screen:

<?php $test = ''; if ($test) { echo '+++'; } else { echo '---'; } ?>

Without running the code, determine what will be displayed on the screen:

<?php $test = 3 * 'abc'; if ($test) { echo '+++'; } else { echo '---'; } ?>

Without running the code, determine what will be displayed on the screen:

<?php $test = null; if ($test) { echo '+++'; } else { echo '---'; } ?>

Without running the code, determine what will be displayed on the screen:

<?php $test = false; if ($test) { echo '+++'; } else { echo '---'; } ?>

Without running the code, determine what will be displayed on the screen:

<?php $test; if ($test) { echo '+++'; } else { echo '---'; } ?>

Without running the code, determine what will be displayed on the screen:

<?php $test = 0; if ($test) { echo '+++'; } else { echo '---'; } ?>

Without running the code, determine what will be displayed on the screen:

<?php $test = '0'; if ($test) { echo '+++'; } else { echo '---'; } ?>

Without running the code, determine what will be displayed on the screen:

<?php $test = -1; if ($test) { echo '+++'; } else { echo '---'; } ?>
English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline