Path-PHP requires PHP 8.0 or ulterior versions.
Install with composer :
composer require olinox14/path-php
Then, just import the Path
class :
<?php
use Path\Path;
$path = new Path(__file__);
$dir = $path->parent();
foreach ($dir->files() as $file) {
if ($file->ext() === 'html') {
$file->rename($file->name() . '.md');
}
}