From fa9a258bd2a3c4cd76820db9e433f117be099f3b Mon Sep 17 00:00:00 2001 From: Andrew O'Neil <andy@andyofniall.net> Date: Thu, 13 Dec 2007 22:33:25 +0000 Subject: [PATCH] Merged revisions 46139 via svnmerge from svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.2.1 ........ r46139 | aoneil | 2007-12-03 11:28:34 +1300 (Mon, 03 Dec 2007) | 2 lines #1942 - Object::uninherited() fix for PHP 5.1.2 ........ git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@46814 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/Object.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/core/Object.php b/core/Object.php index 15f719838..c637d57bb 100755 --- a/core/Object.php +++ b/core/Object.php @@ -310,9 +310,14 @@ class Object { $val = $this->stat($name); $val2 = null; try { - $reflection = new ReflectionClass(get_parent_class($this)); - $property = $reflection->getProperty($name); - $val2 = $property->getValue(); + // The reflection doesn't work properly in 5.1.2 + if(phpversion() == '5.1.2') { + $val2 = eval('return ' . get_parent_class($this) . "::\$$name;"); + } else { + $reflection = new ReflectionClass(get_parent_class($this)); + $property = $reflection->getProperty($name); + $val2 = $property->getValue(); + } } catch(Exception $exc) { // do nothing.. the property doesn't exists! }