PHP code example of hexlet / points

1. Go to this page and download the library: Download hexlet/points 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/ */

    

hexlet / points example snippets




use function Php\Points\Points\makePoint;
use function Php\Points\Points\getX;
use function Php\Points\Points\getY;
use function Php\Points\Points\toString;



$point = makePoint(1, 2);

$x = getX($point); // $x = 1;
$y = getY($point) // $y = 2;

$example = toString($point); // $example = "(1, 2)";