My hosting service uses PHP 4.2 and when I call get_class() it returns the classname in all lower case. Does anybody know a workaround for this? I'm just passing an instance of a class and need its name. I've tried print_r, gettype, and even serialize() and they all behave the same way!
Anywhere else to hack into it?
need get_class() equivalent that preserves case
Moderator: General Moderators
-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
alternately, you could use a convention where you store the name of the class in its declaration.. i.e.
Code: Select all
<?php
class fOO
{
var $classname = "fOO";
}
// or
class bAr
{
function get_class()
{
return "bAr";
}
}
?>