src/ScalarCollection.php
public function add($value)
    {
        if ( ! is_scalar($value)) {
            throw new InvalidArgumentException(sprintf(
                'Argument 1 passed to %s must be a scalar value, %s given',
                __METHOD__,
                is_object($value) ? get_class($value) : gettype($value)
            ));
        }

        parent::offsetSet(null, $value);
    }
public function add($value)
    {
        if ( ! is_scalar($value)) {
            throw new InvalidArgumentException(sprintf(
                'Argument 1 passed to %s must be a scalar value, %s given',
                __METHOD__,
                is_object($value) ? get_class($value) : gettype($value)
            ));
        }

        parent::offsetSet(null, $value);
    }
public function add ( $ value ) { if ( ! is_scalar ( $ value ) ) { throw new InvalidArgumentException ( sprintf ( 'Argument 1 passed to %s must be a scalar value, %s given' , __METHOD__ , is_object ( $ value ) ? get_class ( $ value ) : gettype ( $ value ) ) ) ; } parent :: offsetSet ( null , $ value ) ; }
Adds a value to this collection

@param scalar $value
Adds a value to this collection