jaytaph / Transphpile

PHP 7 to PHP 5.6 Transpiler
BSD 3-Clause "New" or "Revised" License
177 stars 9 forks source link

php 7.0+: Transphpile should convert Throwable to Exception in plain param types, as well as return type assertions #19

Open TysonAndre opened 7 years ago

TysonAndre commented 7 years ago
set_exception_handler(function (Throwable $throwable) {
    error_log("{$throwable}\n");
    exit(EXIT_FAILURE);
});

function other_example() : Throwable { return new Exception(); }

https://secure.php.net/manual/en/class.throwable.php

(The first example was a bug that was encountered)