Tag Archives: PHP

PHP 7: 10 Things You Need to Know

PHP 7 boasts speeds faster than Facebook’s Hiphop VM, makes fatal error catchable, and allows type declarations

 

Are you a web developer or a website owner? Do your sites run on PHP-enabled CMS such as WordPress, Drupal, Joomla or Magento? Then I have good news for you: the feature-complete beta of the new PHP 7 was recently released. The 7.0.0 major release contains so many

Read more from the source: hongkiat.com

How To Safely Hash A Password

If you’re not using bcrypt get with it or be vulnerable

 

Coda Hale writes:

Use bcrypt.

Why Not {MD5, SHA1, SHA256, SHA512, SHA-3, etc}?

These are all general purpose hash functions, designed to calculate a digest of huge amounts of data in as short a time as possible. This means that they are fantastic for ensuring the integrity of data and utterly rubbish for storing passwords.

A modern server can calculate the MD5 hash of about 330MB every second. If your users have passwords which are lowercase, alphanumeric, and 6 characters long, you can try every single possible password of that size in around 40 seconds.

For PHP 5.5, use password_hash(). For PHP 5.3.7 through PHP 5.4.x use the password_compat polyfill on GitHub.

Read the full article at codahale.com

A walkthrough on methods on primitive types in PHP 7

Manipulating primitives in PHP 7 will be more straightforward

 

The likely most common complaint you get to hear about PHP is the inconsistent and unclear naming of functions in the standard library, as well as the equally inconsistent and unclear order of parameters. Some typical examples are strpos, str_replace, strcspn.

While this issue is often overemphasized (we do have IDEs), it is hard to deny that the situation is rather suboptimal. It should also be noted that many functions exhibit problems that go beyond having a weird name. Often edge-case behaviors were not properly considered, thus creating the need to specially handle them in the calling code. (For the string functions edge-cases usually involve empty strings or offsets that are at the very end of a string.)

Read more at nikic.github.io

WordPress 4.0 “Benny”

No breaking changes but lots of UI and UX improvements for editors

 

Version 4.0 of WordPress, named “Benny” in honor of jazz clarinetist and bandleader Benny Goodman, is available for download or update in your WordPress dashboard.

Don’t be afraid of breaking changes. It seems this 4.0 release should really be a 3.10 release because there are no breaking changes. See http://semver.org/ for proper semantic versioning.

Improvements cover three main areas:

1. Better editing experience including a fixed right bar, auto embedding of videos and tweets, and more intuitive editor.

2. An improved plugin browser that will speed up the process of finding good plugins.

3. A better experience for uploading, editing, and viewing media library assets.

Read more from the source: WordPress News