src/Util/Closure/SerializableClosure.php
public function unserialize($serialized)
    {
        // Unserialize the closure data and reconstruct the closure object.
        $this->data = Serialize::decode($serialized, Serializer::getSerializeType());
        $this->closure = __reconstruct_closure($this->data);

        // Throw an exception if the closure could not be reconstructed.
        if (!$this->closure instanceof \Closure) {
            throw new \RuntimeException(
                'The closure is corrupted and cannot be unserialized.'
            );
        }

        // Rebind the closure to its former binding and scope.
        if ($this->data['binding'] || $this->data['isStatic']) {
            $this->closure = $this->closure->bindTo(
                $this->data['binding'],
                $this->data['scope']
            );
        }
    }
public function unserialize($serialized)
    {
        // Unserialize the closure data and reconstruct the closure object.
        $this->data = Serialize::decode($serialized, Serializer::getSerializeType());
        $this->closure = __reconstruct_closure($this->data);

        // Throw an exception if the closure could not be reconstructed.
        if (!$this->closure instanceof \Closure) {
            throw new \RuntimeException(
                'The closure is corrupted and cannot be unserialized.'
            );
        }

        // Rebind the closure to its former binding and scope.
        if ($this->data['binding'] || $this->data['isStatic']) {
            $this->closure = $this->closure->bindTo(
                $this->data['binding'],
                $this->data['scope']
            );
        }
    }
public function unserialize ( $ serialized ) { // Unserialize the closure data and reconstruct the closure object. $ this -> data = Serialize :: decode ( $ serialized , Serializer :: getSerializeType ( ) ) ; $ this -> closure = __reconstruct_closure ( $ this -> data ) ; // Throw an exception if the closure could not be reconstructed. if ( ! $ this -> closure instanceof \ Closure ) { throw new \ RuntimeException ( 'The closure is corrupted and cannot be unserialized.' ) ; } // Rebind the closure to its former binding and scope. if ( $ this -> data [ 'binding' ] || $ this -> data [ 'isStatic' ] ) { $ this -> closure = $ this -> closure -> bindTo ( $ this -> data [ 'binding' ] , $ this -> data [ 'scope' ] ) ; } }
Unserializes the closure.

Unserializes the closure's data and recreates the closure using a
simulation of its original context. The used variables (context) are
extracted into a fresh scope prior to redefining the closure. The
closure is also rebound to its former object and scope.

@param string $serialized

@throws \RuntimeException
@link http://php.net/manual/en/serializable.unserialize.php
Unserializes the closure .