0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-11-14 17:38:42 +00:00
phpv8/tests/pthreads_001.phpt

36 lines
571 B
Plaintext
Raw Normal View History

--TEST--
Test V8::executeString() : Pthreads test #1
--SKIPIF--
<?php
require_once(dirname(__FILE__) . '/skipif.inc');
if(!class_exists('Thread')) {
die('skip pthreads extension required');
}
?>
--FILE--
<?php
class Workhorse extends Thread
{
public function run()
{
$v8 = new V8Js();
if($v8->executeString('(11 + 12)') != 23) {
throw new \Exception('fail');
}
}
}
$foo = new Workhorse('foo');
$bar = new Workhorse('bar');
$foo->start();
$bar->start();
$foo->join();
$bar->join();
?>
===EOF===
--EXPECT--
===EOF===