XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.8
    • Component/s: Parser
    • Labels:
      None

      Description

      <?php
      // Fetches the value of $_GET['user'] and returns 'nobody'
      // if it does not exist.
      $username = $_GET['user'] ?? 'nobody';
      // This is equivalent to:
      $username = isset($_GET['user']) ? $_GET['user'] : 'nobody';
      
      // Coalescing can be chained: this will return the first
      // defined value out of $_GET['user'], $_POST['user'], and
      // 'nobody'.
      $username = $_GET['user'] ?? $_POST['user'] ?? 'nobody';
      ?>
      

      http://php.net/manual/en/migration70.new-features.php#migration70.new-features.null-coalesce-op

        Attachments

          Activity

            People

            Assignee:
            elena.vilchik Elena Vilchik
            Reporter:
            elena.vilchik Elena Vilchik
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: