Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Finds whether a variable is an array
<?php is_array(mixed $value): bool
<?php     public function __construct($event)

    {

        if (

            ! is_array($event) ||

            ! isset($event['requestContext']['routeKey']) ||

            ! isset($event['requestContext']['eventType']) ||

            ! isset($event['requestContext']['connectionId']) ||
<?php     public function __construct($event)

    {

        if (! is_array($event) || ! isset($event['Records'])) {

            throw new InvalidLambdaEvent('DynamoDB', $event);

        }
<?php     public function __construct($record)

    {

        if (! is_array($record) || ! isset($record['eventSource']) || $record['eventSource'] !== 'aws:dynamodb') {

            throw new \InvalidArgumentException('Event source must come from DynamoDB');

        }
<?php     public function __construct($event)

    {

        if (! is_array($event) || ! isset($event['detail-type'])) {

            throw new InvalidLambdaEvent('EventBridge', $event);

        }

        $this->event = $event;
<?php         if (isset($responseHeaders['status'])) {

            $status = (int) (is_array($responseHeaders['status']) ? $responseHeaders['status'][0] : $responseHeaders['status']);

            unset($responseHeaders['status']);

        }
<?php             if ($multiHeaders) {


                $headers[$name] = is_array($values) ? $values : [$values];

            } else {


                $headers[$name] = is_array($values) ? end($values) : $values;
<?php                 $headers[$name] = is_array($values) ? $values : [$values];

            } else {


                $headers[$name] = is_array($values) ? end($values) : $values;

            }

        }
<?php             $name = $this->capitalizeHeaderName($name);



            if ($name === 'Set-Cookie') {

                $cookies = is_array($values) ? $values : [$values];

            } else {
<?php             } else {



                $headers[$name] = is_array($values) ? end($values) : $values;

            }

        }
<?php     public function __construct($event)

    {

        if (! is_array($event) || ! isset($event['Records'])) {

            throw new InvalidLambdaEvent('Kinesis', $event);

        }
<?php     public function __construct($record)

    {

        if (! is_array($record) || ! isset($record['eventSource']) || $record['eventSource'] !== 'aws:kinesis') {

            throw new \InvalidArgumentException('Event source must come from Kinesis');

        }
<?php     public function __construct($event)

    {

        if (! is_array($event) || ! isset($event['Records'])) {

            throw new InvalidLambdaEvent('S3', $event);

        }

        $this->event = $event;
<?php     public function __construct($record)

    {

        if (! is_array($record) || ! isset($record['eventSource']) || $record['eventSource'] !== 'aws:s3') {

            throw new InvalidArgumentException;

        }

        $this->record = $record;
<?php     public function __construct($event)

    {

        if (! is_array($event) || ! isset($event['Records'])) {

            throw new InvalidLambdaEvent('SNS', $event);

        }

        $this->event = $event;
<?php     public function __construct($record)

    {

        if (! is_array($record) || ! isset($record['EventSource']) || $record['EventSource'] !== 'aws:sns') {

            throw new InvalidArgumentException;

        }

        $this->record = $record;