Home » PHP » PHP Constants » Question
  1. What will be the output of the following PHP code ?
    <?php
    define('OCTAL_NUM1', 0500);
    define('OCTAL_NUM2', 0300);
    print OCTAL_NUM1;
    echo "\n";
    print OCTAL_NUM2;
    ?>
    1. 320
    2. Error
    3. 320
      192
    4. 192
    5. None of these
Correct Option: C

Anything starting from 0 is evaluated as an octal.



Your comments will be displayed only after manual approval.