How to create your .phar from your class or file .php?

actually a question for the phar

suppose there is a class which is SimpleClass.php

<?php
class SimpleClass
{
 // declare properties
 public $var = 'a default value';

 // method Declaration
 public function displayVar() {
 echo $this->var;
}
}


how to make this SimpleClass.php ready SimpleClass.phar
April 4th 20 at 00:43
2 answers
April 4th 20 at 00:45
Solution
April 4th 20 at 00:47
Solution
Designer new Phar('my_new_phar.phar') creates a new archive
addFile('SimpleClass.php') adds to archive your class files.

Find more questions by tags PHPPhar