Skip to content

Instantly share code, notes, and snippets.

@JesusTheHun
Created January 26, 2016 08:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JesusTheHun/70ae9001d43dc741c4a8 to your computer and use it in GitHub Desktop.
Save JesusTheHun/70ae9001d43dc741c4a8 to your computer and use it in GitHub Desktop.
<?php
use Monolog\Handler\StreamHandler;
use Monolog\Logger;
require 'vendor/autoload.php';
class MyThread extends Thread
{
public function run()
{
echo 'hihi', PHP_EOL;
$log = new Logger('MyApp');
$log->pushHandler(
new StreamHandler('php://stdout', Logger::INFO)
);
$log->addInfo("hoho");
echo 'haha', PHP_EOL;
}
}
$thread = new MyThread();
if ($thread->start()) {
$thread->join();
echo 'hehe', PHP_EOL;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment