php 5.5

http://nikic.github.com/2012/07/10/What-PHP-5-5-might-look-like.html

  • Argument skipping: my_function(“hello”, default, default, true);
  • Password hashing routines
  • Getter and setters which has shorter syntax
  • class TimePeriod {
        public $seconds;
    
        public $hours {
            get { return $this->seconds / 3600; }
            set { $this->seconds = $value * 3600; }
        }
    }
    
    $timePeriod = new TimePeriod;
    $timePeriod->hours = 10;
    
    var_dump($timePeriod->seconds); // int(36000)
    var_dump($timePeriod->hours);   // int(10)
    

     

  • Iterators dont use another copt of array, but just return the values
  • $str .= "0123456789abcdef"[mt_rand(0, 15)]; // direct dereference of string
  • array_column() function
  • Better class syntax (eg Namespace:class instead of Namespace)
  • Windows XP and 2003 support dropped

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s