php-5.2
Creating DateTime from timestamp in PHP < 5.3
PHP 5 >= 5.3.0 $date = new DateTime(); $date->setTimestamp($timeStamp); Edit: Added correct PHP version for setTimestamp
Assigning the return value of new by reference is deprecated
In PHP5 this idiom is deprecated $obj_md =& new MDB2(); You sure you’ve not missed an ampersand in your sample code? That would generate the warning you state, but it is not required and can be removed. To see why this idiom was used in PHP4, see this manual page (note that PHP4 is long … Read more
How to get protected property of object in PHP
Here’s the really simple example (with no error checking) of how to use ReflectionClass: function accessProtected($obj, $prop) { $reflection = new ReflectionClass($obj); $property = $reflection->getProperty($prop); $property->setAccessible(true); return $property->getValue($obj); } I know you said you were limited to 5.2, but that was 2 years ago, 5.5 is the oldest supported version and I’m hoping to help … Read more
Get current domain
Try using this: $_SERVER[‘SERVER_NAME’] Or parse: $_SERVER[‘REQUEST_URI’] Reference: apache_request_headers()