#47170 [NEW]: cast, gettype mishmash

From: Date: Tue, 20 Jan 2009 15:52:16 +0000
Subject: #47170 [NEW]: cast, gettype mishmash
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-133072@lists.php.net to get a copy of this message
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

« previous php.bugs (#133072) next »