Example #1
0
 /**
  * Destructor.
  */
 public function __destruct()
 {
     parent::__destruct();
 }
     * if this object is less than the given object,
     * zero if this object equals the given object, and
     * a number greater than zero
     * if this object is greater than the given object.
     */
    public function compare(IComparable $object)
    {
        $result = 0;
        if ($this->getClass() == $object->getClass()) {
            $result = $this->compareTo($object);
        } else {
            $result = strcmp($this->getClass()->getName(), $object->getClass()->getName());
        }
        return $result;
    }
    //}>b
    /**
     * Main program.
     *
     * @param array $args Command-line arguments.
     * @return integer Zero on succes; non-zero on failure.
     */
    public static function main($args)
    {
        printf("AbstractComparable main program.\n");
        return 0;
    }
}
if (realpath($argv[0]) == realpath(__FILE__)) {
    exit(AbstractComparable::main(array_slice($argv, 1)));
}
Example #3
0
 /**
  * Destructor.
  */
 public function __destruct()
 {
     $this->key = NULL;
     $this->value = NULL;
     parent::__destruct();
 }
Example #4
0
 /**
  * Destructor.
  */
 public function __destruct()
 {
     $this->graph = NULL;
     $this->weight = NULL;
     parent::__destruct();
 }