www.webdeveloper.com
Results 1 to 3 of 3

Thread: [RESOLVED] Pre-decrementing operators (Zend Cert)

  1. #1
    Join Date
    Apr 2006
    Posts
    245

    resolved [RESOLVED] Pre-decrementing operators (Zend Cert)

    Hi again,

    Personally, I can't see how any of the answers below are suitable - but i'm obviously wrong. Can anyone advise?

    Q: What is the output of the following?

    PHP Code:
    <?php
    function 1dotEach($n)
    {
      if (
    $n 0)
      {
        
    1dotEach(--$n);
        echo 
    ".";
      }else 
      {
        return 
    $n;
      }
    }
    1dotEach(4);
    ?>
    Answers (Choose 1):
    ...0
    Parse Error: Syntax Error
    .....
    ....
    ...

    Grazie,
    Picco

  2. #2
    Join Date
    Nov 2008
    Posts
    2,477
    Function names cannot begin with a number - parse error.

    http://www.php.net/manual/en/functions.user-defined.php
    The first rule of Tautology Club is the first rule of Tautology Club.

  3. #3
    Join Date
    Apr 2006
    Posts
    245
    Thanks, well spotted Mindzai. I totally never seen that.

    Cheers :thumbsup:

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles