Edit report at https://bugs.php.net/bug.php?id=70922&edit=1
ID: 70922
Updated by: [email protected]
Reported by: no367 at vip dot qq dot com
Summary: php类型约束失效
-Status: Open
+Status: Feedback
Type: Bug
Package: PHP Language Specification
Operating System: Window 7
PHP Version: 5.5.30
Block user comment: N
Private report: N
New Comment:
I am not sure what the problem is?
they behavior the same to me:
PHP Catchable fatal error: Argument 1 passed to test() must be of the type array, string given, called in /tmp/1.php on line 7
and
PHP Catchable fatal error: Argument 1 passed to test\test() must be of the type array, string given, called in /tmp/1.php on line 7
Previous Comments:
------------------------------------------------------------------------
[2015-11-16 13:12:17] no367 at vip dot qq dot com
Description:
------------
<?php
namespace test;
function text( array $arr ){
print_r($arr);
}
//not working
text('text');
Test script:
---------------
<?php
namespace test;
function test( array $arr ){
print_r($arr);
}
//not working
test('test');
<?php
function test( array $arr ){
print_r($arr);
}
//is working
test('test');
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70922&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.