Bug #76162 [Opn->Wfx]: type-hint broken with custom error handling function
| From: | cmb@php.net | Date: | Thu, 29 Mar 2018 13:46:33 +0000 |
| Subject: | Bug #76162 [Opn->Wfx]: type-hint broken with custom error handling function | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-214526@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76162&edit=1
ID: 76162
Updated by: cmb@php.net
Reported by: joseaugustodearaujonascimento at gmail dot com
Summary: type-hint broken with custom error handling function
-Status: Open
+Status: Wont fix
Type: Bug
-Package: PHP Language Specification
+Package: Unknown/Other Function
Operating System: Debian 9
PHP Version: 5.6.34
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
> This bug only affects PHP versions 5.6.x.
Active support for PHP 5.6 ended more than a year ago[1].
[1] <http://www.php.net/supported-versions.php>
Previous Comments:
------------------------------------------------------------------------
[2018-03-29 13:35:54] joseaugustodearaujonascimento at gmail dot com
Description:
------------
This bug only affects PHP versions 5.6.x.
Test script:
---------------
<?php
class Event {
public function setTime(\DateTime $time) {
var_dump($time);
}
}
function set_event_time(\DateTime $time) {
var_dump($time);
}
function e_handler() {
restore_error_handler();
}
set_error_handler('e_handler');
$e = new Event();
$e->setTime(false);
set_event_time(false);
Expected result:
----------------
Fatal error: Uncaught TypeError: Argument 1 passed to Event::setTime() must be an instance of
DateTime, boolean given, called in %s on line %d and defined in %s:%d
Actual result:
--------------
bool(false)
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76162&edit=1