#26762 [Csd]: unserialize() produces lowercase classnames
ID: 26762
User updated by: mail at alexanderklein dot de
Reported By: mail at alexanderklein dot de
Status: Closed
Bug Type: Class/Object related
Operating System: *
PHP Version: 5.0.0RC1-dev
Assigned To: helly
New Comment:
Thanx a lot!
Previous Comments:
------------------------------------------------------------------------
[2004-01-01 22:24:07] helly@php.net
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
------------------------------------------------------------------------
[2004-01-01 22:19:42] helly@php.net
Actually unserialized lowercases the classname. But we store the
lowercased classname only in the hashtable while we preserver the
casing for its real name.
------------------------------------------------------------------------
[2004-01-01 21:25:01] helly@php.net
Behavior is correct as you can see below:
marcus@zaphod /usr/src/php5 $ php -r 'class FOO{}$o=new
FOO;var_dump(serialize($o));'
string(14) "O:3:"FOO":0:{}"
marcus@zaphod /usr/src/php5 $ php -r
'$o=unserialize("O:3:\"FOO\":0:{}");var_dump($o);'
object(__PHP_Incomplete_Class)#1 (1) {
["__PHP_Incomplete_Class_Name"]=>
string(3) "foo"
}
marcus@zaphod /usr/src/php5 $ php -r 'class
FOO{}$o=unserialize("O:3:\"FOO\":0:{}");var_dump($o);'
object(FOO)#1 (0) {
}
------------------------------------------------------------------------
[2004-01-01 20:21:26] mail at alexanderklein dot de
Ok, you say
> In php class names are not case sensitive and are
> stored in lowercase form internally.
but why does the __autoload() function not convert to
lowercase if i make an instance like "new myTestWithUpper"?
this is a _little_ bit confusing :-(
------------------------------------------------------------------------
[2004-01-01 19:42:50] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
In php class names are not case sensitive and are stored in
lowercase form internally.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/26762
--
Edit this bug report at http://bugs.php.net/?id=26762&edit=1
Thread (8 messages)