Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Creates a PHP value from a stored representation
<?php unserialize(string $data, array $options = []): mixed
<?php         $record = $this->table->get($key);



        if (! $this->recordIsFalseOrExpired($record)) {

            return unserialize($record['value']);

        }



        if (in_array($key, $this->intervals) &&
<?php     {

        $interval = $this->get('interval-'.$key);



        return $interval ? unserialize($interval) : null;

    }
<?php             return tap($value, fn ($value) => $this->put($key, $value, static::ONE_YEAR));

        }



        return tap((int) (unserialize($record['value']) + $value), function ($value) use ($key, $record) {

            $this->put($key, $value, $record['expiration'] - Carbon::now()->getTimestamp());

        });

    }
<?php         OctaneFacade::route('POST', '/octane/resolve-tasks', function (Request $request) {

            try {

                return new Response(serialize((new SwooleTaskDispatcher)->resolve(

                    unserialize(Crypt::decryptString($request->input('tasks'))),

                    $request->input('wait')

                )), 200);

            } catch (DecryptException) {
<?php         OctaneFacade::route('POST', '/octane/dispatch-tasks', function (Request $request) {

            try {

                (new SwooleTaskDispatcher)->dispatch(

                    unserialize(Crypt::decryptString($request->input('tasks'))),

                );

            } catch (DecryptException) {

                return new Response('', 403);
<?php             ]);



            return match ($response->status()) {

                200 => unserialize($response),

                504 => throw TaskTimeoutException::after($waitMilliseconds),

                default => throw TaskExceptionResult::from(

                    new Exception('Invalid response from task server.'),