src/Util/Closure/SerializableClosure.php
public function serialize()
    {
        try {
            $this->data = $this->data ?: Serializer::getData($this->closure, true);

            return Serialize::encode($this->data, Serializer::getSerializeType());
        } catch (\Exception $e) {
            \trigger_error('Serialization of closure failed: ' . $e->getMessage());
            // Note: The serialize() method of Serializable must return a string
            // or null and cannot throw exceptions.
            return null;
        }
    }
public function serialize()
    {
        try {
            $this->data = $this->data ?: Serializer::getData($this->closure, true);

            return Serialize::encode($this->data, Serializer::getSerializeType());
        } catch (\Exception $e) {
            \trigger_error('Serialization of closure failed: ' . $e->getMessage());
            // Note: The serialize() method of Serializable must return a string
            // or null and cannot throw exceptions.
            return null;
        }
    }
public function serialize ( ) { try { $ this -> data = $ this -> data ? : Serializer :: getData ( $ this -> closure , true ) ; return Serialize :: encode ( $ this -> data , Serializer :: getSerializeType ( ) ) ; } catch ( \ Exception $ e ) { \ trigger_error ( 'Serialization of closure failed: ' . $ e -> getMessage ( ) ) ; // Note: The serialize() method of Serializable must return a string // or null and cannot throw exceptions. return null ; } }
Serializes the code, context, and binding of the closure.

@return string|null
@link http://php.net/manual/en/serializable.serialize.php
Serializes the code context and binding of the closure .