/** * tests the __toString() functionality */ public function testToString() { $valueObject = new Zend_Memory_Value('0123456789', new Zend_Memory_Container_Movable_Dummy()); $this->assertEquals($valueObject->__toString(), '0123456789'); if (version_compare(PHP_VERSION, '5.2') < 0) { // Skip following tests for PHP versions before 5.2 return; } $this->assertEquals(strlen($valueObject), 10); $this->assertEquals((string) $valueObject, '0123456789'); }
/** * Start modifications trace * * @internal */ public function startTrace() { if (!($this->_state & self::LOADED)) { $this->_memManager->load($this, $this->_id); $this->_state |= self::LOADED; } $this->_value->startTrace(); }
/** * Zend_Memory_Container interface * * Process container value update. * Must be called only by value object */ public function processUpdate() { if ($this->_state & self::SWAPPED) { /** @todo Clear swap */ $this->_state &= ~self::SWAPPED; } $this->_size = strlen($this->_value->getRef()); }