public function CustomArrayObject::offsetSet

File

drupal/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/CollectionValidatorCustomArrayObjectTest.php, line 37

Class

CustomArrayObject
This class is a hand written simplified version of PHP native `ArrayObject` class, to show that it behaves differently than the PHP native implementation.

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function offsetSet($offset, $value) {
  if (null === $offset) {
    $this->array[] = $value;
  }
  else {
    $this->array[$offset] = $value;
  }
}