$obj = new Varien_Object(array('name' => 'John', 'age' => 30)); $name = $obj->getValue('name'); echo $name; // Output: John
class MyClass extends Varien_Object { public function printValue($key) { $value = $this->getValue($key); echo $value; } } $obj = new MyClass(array('name' => 'John', 'age' => 30)); $obj->printValue('age'); // Output: 30This example extends the `Varien_Object` class to create a custom class `MyClass`. The `printValue` method is defined to retrieve the value of a given key and output it. An instance of `MyClass` is then created with a name and age attribute, and the `printValue` method is called with the key 'age'. Package/Library: Magento