Skip to content

Instantly share code, notes, and snippets.

@mmoreram
Created July 6, 2021 09:48
Show Gist options
  • Save mmoreram/6323b9bf536ba5346e5a26117512c208 to your computer and use it in GitHub Desktop.
Save mmoreram/6323b9bf536ba5346e5a26117512c208 to your computer and use it in GitHub Desktop.
<?php
require "vendor/autoload.php";
$loop = \React\EventLoop\Factory::create();
$filesystem = \React\Filesystem\Filesystem::create($loop);
$filesystem
->file('nonexisting.txt')
->exists()
->then(function(){
var_dump('EXISTS');
die();
})
->otherwise(function(\Exception $exception) {
var_dump('Does not exist');
die();
});
$loop->run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment