Skip to content

Instantly share code, notes, and snippets.

@asgrim

asgrim/async.php

Created Jun 30, 2017
Embed
What would you like to do?
<?php
class x {
async static function highlightFileContents($path) {
$source = await Amp\File\get($path);
return highlight_string($source, true);
}
}
$highlighted = Amp\wait(x::highlightFileContents("helpers.php"));
var_dump($highlighted);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment