Skip to content

Installation

Cédric Belin edited this page Jun 15, 2024 · 3 revisions

Requirements

Before installing Which for PHP, you need to make sure you have PHP and Composer, the PHP package manager, up and running.

You can verify if you're already good to go with the following commands:

php --version
# PHP 8.3.8 (cli) (built: Jun  4 2024 18:52:26) (NTS Visual C++ 2019 x64)

composer --version
# Composer version 2.7.7 2024-06-10 22:11:12

Installing with Composer package manager

1. Install it

From a command prompt, run:

composer require cedx/which

2. Import it

Now in your PHP code, you can use:

use function which\which;