.. _cannot-bind-an-instance-to-a-static-closure,-this-will-be-an-error-in-php-9: Cannot bind an instance to a static closure, this will be an error in PHP 9 --------------------------------------------------------------------------- .. meta:: :description: Cannot bind an instance to a static closure, this will be an error in PHP 9: The ``Closure::bind()`` method gives the scope of execution of a closure. :og:image: https://php-errors.readthedocs.io/en/latest/_static/logo.png :og:type: article :og:title: Cannot bind an instance to a static closure, this will be an error in PHP 9 :og:description: The ``Closure::bind()`` method gives the scope of execution of a closure :og:url: https://php-errors.readthedocs.io/en/latest/messages/cannot-bind-an-instance-to-a-static-closure%2C-this-will-be-an-error-in-php-9.html :og:locale: en :twitter:card: summary_large_image :twitter:site: @exakat :twitter:title: Cannot bind an instance to a static closure, this will be an error in PHP 9 :twitter:description: Cannot bind an instance to a static closure, this will be an error in PHP 9: The ``Closure::bind()`` method gives the scope of execution of a closure :twitter:creator: @exakat :twitter:image:src: https://php-errors.readthedocs.io/en/latest/_static/logo.png .. raw:: html Description ___________ The ``Closure::bind()`` method gives the scope of execution of a closure. And a static closure uses no scope, so the ``bind()`` method fails. Example _______ .. code-block:: php bindTo(new Stdclass()); $closure(); ?> Solutions _________ + Remove the static option on the closure. + Remove the call to ``bind()``. In previous PHP versions, this error message used to be :ref:`cannot-bind-an-instance-to-a-static-closure`.