PHP - Fonction Thread :: globally ()

Thread :: globalement - Exécution

Syntaxe

public static mixed Thread::globally( void )

La fonction Thread :: globally () peut exécuter Callable dans une portée globale.

La fonction Thread :: globally () n'a aucun paramètre et peut renvoyer la valeur de Callable.

Exemple

<?php
   class My extends Thread {
      public function run() {
         global $std;
         Thread::globally(function() {
            $std = new stdClass;
         });
         var_dump($std);
      }
   }
   $my = new My();
   $my->start();
?>