Bug #70117 [Opn->Csd]: Unexpected return type error
| From: | laruence@php.net | Date: | Thu, 23 Jul 2015 03:24:17 +0000 |
| Subject: | Bug #70117 [Opn->Csd]: Unexpected return type error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-194644@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=70117&edit=1
ID: 70117
Updated by: laruence@php.net
Reported by: laruence@php.net
Summary: Unexpected return type error
-Status: Open
+Status: Closed
Type: Bug
Package: Scripting Engine problem
PHP Version: 7.0.0beta1
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=a123876b4e181731e3d95cabfb88bbc42d7d844b
Log: Fixed bug #70117 (Unexpected return type error)
Previous Comments:
------------------------------------------------------------------------
[2015-07-23 03:11:42] laruence@php.net
Description:
------------
return type are not well tested, it sometimes throw unexcepted errors while meet IS_INDIREcT or
IS_REFERENCE
Test script:
---------------
<?php
$array = array(1, 2, 3);
debug_zval_dump($array);
var_dump(foo());
function &foo() :string {
global $array;
return $array[1];
}
Expected result:
----------------
no error
Actual result:
--------------
PHP Fatal error: Uncaught TypeError: Return value of foo() must be of the type string, unknown
returned in /tmp/1.php on line 10 in /tmp/1.php:10
Stack trace:
#0 /tmp/1.php(6): foo()
#1 {main}
thrown in /tmp/1.php on line 10
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70117&edit=1