| 114 | | return self::getStringRepresentationOf($this, get_object_vars($this)); |
|---|
| | 114 | return self::getStringRepresentationOf($this, $this->_extractProperties($this)); |
|---|
| | 115 | } |
|---|
| | 116 | |
|---|
| | 117 | /** |
|---|
| | 118 | * helper method to extract all properties regardless of their visibility |
|---|
| | 119 | * |
|---|
| | 120 | * This is a workaround for the problem that as of PHP 5.2.4 get_object_vars() |
|---|
| | 121 | * is not any more capable of retrieving private properties from child classes. |
|---|
| | 122 | * See http://stubbles.org/archives/32-Subtle-BC-break-in-PHP-5.2.4.html. |
|---|
| | 123 | * |
|---|
| | 124 | * @return array<string,mixed> |
|---|
| | 125 | */ |
|---|
| | 126 | protected function _extractProperties($object) |
|---|
| | 127 | { |
|---|
| | 128 | $properties = (array) $object; |
|---|
| | 129 | $fixedProperties = array(); |
|---|
| | 130 | foreach ($properties as $propertyName => $propertyValue) { |
|---|
| | 131 | if (strstr($propertyName, "\0") === false) { |
|---|
| | 132 | $fixedProperties[$propertyName] = $propertyValue; |
|---|
| | 133 | continue; |
|---|
| | 134 | } |
|---|
| | 135 | |
|---|
| | 136 | $fixedProperties[substr($propertyName, strrpos($propertyName, "\0") + 1)] = $propertyValue; |
|---|
| | 137 | } |
|---|
| | 138 | |
|---|
| | 139 | return $fixedProperties; |
|---|