# c()

```php
/**
 * @throws Throwable
 *
 * This method is used to create a new promise.
 */
public static function c(callable $callback, bool $justGetResult = false): Promise;
```

Usually you just need to use like this:

<pre class="language-php"><code class="lang-php"><strong>$promise = new Promise(function($resolve, $reject) {
</strong>    $resolve("Hello World");
});
</code></pre>

With the **`c()`** method, you can implement it briefly with the Arrow Promise type:

```php
Promise::c(fn($resolve, $reject) => $resolve("Hello World"));
```

Even if you don't like the **`new Class()`** format, you can use it to make a promise at the top:

```php
Promise::c(function($resolve, $reject) {
    $resolve("Hello World");
});
```
