Bug #72436 [Opn->Nab]: PHP 5.6.11-1ubuntu3.4
| From: | requinix@php.net | Date: | Thu, 16 Jun 2016 21:45:12 +0000 |
| Subject: | Bug #72436 [Opn->Nab]: PHP 5.6.11-1ubuntu3.4 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-201686@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72436&edit=1
ID: 72436
Updated by: requinix@php.net
Reported by: aydoganserdar at gmail dot com
Summary: PHP 5.6.11-1ubuntu3.4
-Status: Open
+Status: Not a bug
Type: Bug
Package: Strings related
Operating System: Ubuntu 15.04
PHP Version: 5.6.22
Block user comment: N
Private report: N
New Comment:
Your error message doesn't match up with your code, and your code has a syntax error.
PHP 5.6 does not have type hints for strings. Only PHP 7+.
Previous Comments:
------------------------------------------------------------------------
[2016-06-16 21:26:26] aydoganserdar at gmail dot com
test script fixes
Error scenario:
namespace app/aa
use string;
class A {
public function B()
{
$c = $this->getC('getC');
$d = $this->getD('getD');
}
private function getC(string $c)
{
return $c;
}
private function getD(string $d)
{
return $d;
}
}
Worked if delete function "getC":
class A {
public function B()
{
//$c = $this->getC('getC');
$d = $this->getD('getD');
}
/* private function getC(string $c)
{
return $c;
}*/
private function getD(string $d)
{
return $d;
}
}
------------------------------------------------------------------------
[2016-06-16 21:20:47] aydoganserdar at gmail dot com
Description:
------------
variable type error.
Error:
PHP Catchable fatal error: Argument 1 passed to app/aa::A() must be an instance of string, string
given, called in A.php on line 10 and defined in A.php on line 17
System Info:
PHP 5.6.11-1ubuntu3.4 (cli)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
with Xdebug v2.3.3, Copyright (c) 2002-2015, by Derick Rethans
Test script:
---------------
Error scenario:
namespace app/aa
use string;
class A {
public function B()
{
$c = $this->getC('getC');
$d = $this->getC('getD');
}
private function getC(string $c)
{
return $c;
}
private function getD(string $d)
{
return $d;
}
}
Worked if delete function "getC":
class A {
public function B()
{
$c = $this->getC('getC');
$d = $this->getC('getD');
}
private function getC(string $c)
{
return $c;
}
private function getD(string $d)
{
return $d;
}
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72436&edit=1