Skip to content

Commit

Permalink
better README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tito10047 committed Aug 27, 2024
1 parent f0351f2 commit 50ae9cf
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ A defer statement pushes a function call onto a list. The list of saved calls
is executed after the surrounding function returns. Defer is commonly used to
simplify functions that perform various clean-up actions.

#### Quick example
---
### Installation

```shell
composer require tito10074/defer
```
## Quick example

```php
function foo($a){
Expand Down Expand Up @@ -37,9 +43,7 @@ in defer 2
in defer 1
end
```

----
#### Overview
## Overview

For example, let's look at a function that opens two files and copies the
contents of one file to the other:
Expand Down Expand Up @@ -162,12 +166,6 @@ echo "{$i}-{$o->i}".PHP_EOL;
- In php defer implementation you can't modify returned value. Can modify only content of returned reference
- You need instantiate defer object before use it with ```$defer = new Defer()``` or ```$defer = defer()```

---
### Installation

```shell
composer require tito10074/defer
```

---
### Usage
Expand Down

0 comments on commit 50ae9cf

Please sign in to comment.