PHP code example of sdn / test-simple-car

1. Go to this page and download the library: Download sdn/test-simple-car library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sdn / test-simple-car example snippets


use GrftTestSimpleCar\SimpleCar;

$car = new SimpleCar('Toyota', 'Corolla', 2020);
$car->start();

echo $car;
// e.g.: 550e8400-e29b-41d4-a716-446655440000 2020 Toyota Corolla (SimpleCar) Running

$car = new SimpleCar('Honda', 'Civic', 2021, 'my-custom-id');
echo $car->getId();