3v4l.org

run code in 300+ PHP versions simultaneously
<?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 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Warning: require(): open_basedir restriction in effect. File(//autoload.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/ArmdI on line 7 Warning: require(//autoload.php): Failed to open stream: Operation not permitted in /in/ArmdI on line 7 Fatal error: Uncaught Error: Failed opening required '//autoload.php' (include_path='.:') in /in/ArmdI:7 Stack trace: #0 {main} thrown in /in/ArmdI on line 7
Process exited with code 255.
Output for 8.0.0 - 8.0.13
Warning: require(//autoload.php): Failed to open stream: No such file or directory in /in/ArmdI on line 7 Fatal error: Uncaught Error: Failed opening required '//autoload.php' (include_path='.:') in /in/ArmdI:7 Stack trace: #0 {main} thrown in /in/ArmdI on line 7
Process exited with code 255.
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.26, 7.4.33
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 7.4.27 - 7.4.32
Warning: require(): open_basedir restriction in effect. File(//autoload.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/ArmdI on line 7 Warning: require(//autoload.php): failed to open stream: Operation not permitted 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 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 5.2.3 - 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.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.2
<br /> <b>Parse error</b>: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '(' in <b>/in/ArmdI</b> on line <b>3</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
<br /> <b>Parse error</b>: parse error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '(' in <b>/in/ArmdI</b> on line <b>3</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.3.4
<br /> <b>Parse error</b>: parse error, expecting `T_CONSTANT_ENCAPSED_STRING' or `'('' in <b>/in/ArmdI</b> on line <b>3</b><br />
Process exited with code 255.

preferences:
304.29 ms | 401 KiB | 468 Q