• PHP Video Tutorials

PHP - Thread::globally() Function



Thread::globally - Execution

Syntax

public static mixed Thread::globally( void )

Thread::globally() function can execute Callable in a global scope.

Thread::globally() function doesn't have any parameters and can return the value of Callable.

Example

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