News for hackers. Stuff that matters.
Re:An Exceptional Change in PHP 7.0 by sarciszewski on Monday October 05, 2015 @08:35PM (#10336041)
Amusingly, after months of pointless bikeshedding, we managed to convince the internals team to throw an exception during the extreme case of a CSPRNG failure.

https://www.sammyk.me/security-changes-to-the-php-7-csprng-i...

You can read my arguments on the mailing list, but basically it amounted to:

    $chars = 'abcdefghijklmnopqrstuvwxyz234567';
    for ($i = 0; $i < 12; ++$i) {
        $password .= $chars[random_int(0, 31)];
    }
If random_int() returned FALSE, $password would be the string 'aaaaaaaaaaaa' (and you'd have 12 E_WARNING errors in your log).

By making it an exception, random_int() will now fail closed (kill the script by default), but the developer can still handle it gracefully.

    $chars = 'abcdefghijklmnopqrstuvwxyz234567';
    try {
        for ($i = 0; $i < 12; ++$i) {
            $password .= $chars[random_int(0, 31)];   
        }
    } catch (Throwable $e) {
        $framework->template->kill('An unrecoverable fatal error occurred.');
    }
Or something similar.

Is it a BC break? Sure. Is it worth it? Oh yeah.

Re:An Exceptional Change in PHP 7.0 by debacle on Tuesday October 06, 2015 @09:19AM (#10338635)
We need more BC breaks, not fewer. I'd really like to see a lot of functions that return FALSE on failure throw exceptions in the future. We could also tidy up the stdlib a bit and give primatives some OO love.

If you're going to break BC, might as well do it right.

Re:An Exceptional Change in PHP 7.0 by sarciszewski on Tuesday October 06, 2015 @10:17AM (#10339024)
So, onwards to PHP (gr)8?
Re:An Exceptional Change in PHP 7.0 by debacle on Tuesday October 06, 2015 @10:25AM (#10339083)
I'm hoping Hack can liberate us.