3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php use Amp\MultiProcess\PhpDispatcher, Amp\MultiProcess\CallResult, Amp\ReactorFactory; require dirname(__DIR__) . '/autoload.php'; require __DIR__ . '/support_files/async_mailer/MyAsyncMailer.php'; $reactor = (new ReactorFactory)->select(); $include = __DIR__ . '/support_files/async_mailer/StaticMailWorker.php'; $dispatcher = new PhpDispatcher($reactor, $include, $workerProcessesToSpawn = 8); $mailer = new MyAsyncMailer($dispatcher); $mailJobs = [ [$to ='test1@test.com', $from='address@me.com', $subject='my test', $body='body', $headers=[]], [$to ='test2@test.com', $from='address@me.com', $subject='my test', $body='body', $headers=[]], [$to ='test3@test.com', $from='address@me.com', $subject='my test', $body='body', $headers=[]], [$to ='test4@test.com', $from='address@me.com', $subject='my test', $body='body', $headers=[]], [$to ='test5@test.com', $from='address@me.com', $subject='my test', $body='body', $headers=[]], [$to ='test6@test.com', $from='address@me.com', $subject='my test', $body='body', $headers=[]], [$to ='test7@test.com', $from='address@me.com', $subject='my test', $body='body', $headers=[]], [$to ='test8@test.com', $from='address@me.com', $subject='my test', $body='body', $headers=[]] ]; // Kick things off when the reactor starts $reactor->once(function() use ($mailer, $mailJobs) { $mailer->dispatch($mailJobs); }); // Release the hounds! This should always be the last thing that happens in the script. $reactor->run();
Output for 5.4.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: require(//autoload.php): failed to open stream: No such file or directory in /in/ArmdI on line 7 Fatal error: require(): Failed opening required '//autoload.php' (include_path='.:') in /in/ArmdI on line 7
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Fatal error: File not found: //autoload.php in /in/ArmdI on line 7
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/ArmdI on line 10
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '(' in /in/ArmdI on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '(' in /in/ArmdI on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_CONSTANT_ENCAPSED_STRING' or `'('' in /in/ArmdI on line 3
Process exited with code 255.