Created
July 6, 2021 09:48
-
-
Save mmoreram/6323b9bf536ba5346e5a26117512c208 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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