From:             lunter at interia dot pl
Operating system: all
PHP version:      6CVS-2009-01-20 (snap)
PHP Bug Type:     Feature/Change Request
Bug description:  cast, gettype mishmash

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 bug report at http://bugs.php.net/?id=47170&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=47170&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=47170&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=47170&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=47170&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=47170&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=47170&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=47170&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=47170&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=47170&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=47170&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=47170&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=47170&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=47170&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=47170&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=47170&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=47170&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=47170&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=47170&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=47170&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=47170&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=47170&r=mysqlcfg

Reply via email to