You are here

public function CustomArrayObject::offsetSet in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/validator/Tests/Fixtures/CustomArrayObject.php \Symfony\Component\Validator\Tests\Fixtures\CustomArrayObject::offsetSet()

File

vendor/symfony/validator/Tests/Fixtures/CustomArrayObject.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\Fixtures

Code

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