php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69929 EngineExceptions broken in alpha 2
Submitted: 2015-06-25 08:16 UTC Modified: 2015-06-25 09:00 UTC
From: cameron dot adam+php at gmail dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 7.0.0alpha1 OS: Windows 7 64-bit
Private report: No CVE-ID: None
 [2015-06-25 08:16 UTC] cameron dot adam+php at gmail dot com
Description:
------------
See code.

On alpha 1 this returns "EngineException caught".

On alpha 2 it returns:

Fatal error: Uncaught TypeError: Argument 1 passed to takesInt() must be of the type integer, string given

I suspect it's something to do with the new Throwable support, at a guess.

This is the first bug I've raised, so lemme know if I've done it wrong,or you need more info. Cheers.

Test script:
---------------
try {
    function takesInt(int $x){
        return true;
    }

    takesInt('not an int');
} catch(EngineException $e) {
	echo 'EngineException caught<br>';
}


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-06-25 08:39 UTC] laruence@php.net
-Status: Open +Status: Not a bug
 [2015-06-25 08:39 UTC] laruence@php.net
sorry for that, but we changed the exception inheritance recently ,please read the "
Changes to error handling" section in: https://github.com/php/php-src/blob/master/UPGRADING
 [2015-06-25 09:00 UTC] cameron dot adam+php at gmail dot com
Gotcha. So what was an EngineException yesterday is a TypeError today (and tested that, and it works fine). Cheers.

PS: you do not have "alpha 2" as an option in the dropdown when raising a new bug. Forgot to mention that before.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun Mar 29 13:01:26 2020 UTC