#47170 [Opn->Bgs]: cast, gettype mishmash
| From: | johannes@php.net | Date: | Wed, 21 Jan 2009 11:18:55 +0000 |
| Subject: | #47170 [Opn->Bgs]: cast, gettype mishmash | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-133102@lists.php.net to get a copy of this message | ||
ID: 47170
Updated by: johannes@php.net
Reported By: lunter at interia dot pl
-Status: Open
+Status: Bogus
Bug Type: Feature/Change Request
Operating System: all
PHP Version: 6CVS-2009-01-20 (snap)
New Comment:
This was discussed a lot on the developers list and decided to eep this
way.
Previous Comments:
------------------------------------------------------------------------
[2009-01-20 15:52:16] lunter at interia dot pl
Description:
------------
mishmash with casting and gettype
Reproduce code:
---------------
<?
$v=(string)'';
print('1. variable casted as string has type: '.gettype($v).'<br>');
$v=(unicode)'';
print('2. variable casted as unicode has type: '.gettype($v).'<br>');
$v=(binary)'';
print('3. variable casted as binary has type: '.gettype($v).'<br>');
?>
Expected result:
----------------
I suggest:
1. variable casted as string has type: string (OLD PHP 5 behaviour, in
PHP 6 for binary operation)
2. variable casted as unicode has type: unicode
or
1. variable casted as string has type: string (for unicode)
2. variable casted as binary has type: binary (OLD PHP 5 behaviour, in
PHP 6 for binary operation)
Actual result:
--------------
1. variable casted as string has type: unicode
2. variable casted as unicode has type: unicode
3. variable casted as binary has type: string
---mishmash---
binary -> string -> unicode
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=47170&edit=1