SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast greedyman's Avatar
    Join Date
    Jun 2012
    Location
    New World
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Why $var = 012 / 4 = 2.5?

    As title, anyone know why? I searched on the internet but I donít have an answer yet.

  2. #2
    SitePoint Evangelist
    Join Date
    Oct 2005
    Location
    Michigan, USA
    Posts
    434
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Starting a number with 0 like that means octal (base 8). So octal 12 = decimal 10.

    http://php.net/manual/en/language.types.integer.php
    - Robert

  3. #3
    SitePoint Enthusiast greedyman's Avatar
    Join Date
    Jun 2012
    Location
    New World
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by QMonkey View Post
    Starting a number with 0 like that means octal (base 8). So octal 12 = decimal 10.

    http://php.net/manual/en/language.types.integer.php
    Thanks for helping me! I see your answer.


Bookmarks

Posting Permissions

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