PHP Classes

File: hawkphp/intObj.php

Recommend this page to a friend!
  Packages of tianfan   Hawk PHP Extended Object   hawkphp/intObj.php   Download  
File: hawkphp/intObj.php
Role: Class source
Content type: text/plain
Description: class for INT type
Class: Hawk PHP Extended Object
Manipulating basic data types as objects
Author: By
Last change:
Date: 5 years ago
Size: 797 bytes
 

 

Contents

Class file image Download
<?php

/**
 *@package extendObj
 *@author Tianfan<arrbo@hotmail.com>
 *@license Apache License 2.0
 *@varsion 0.0.2
 *@description this package is a part of hawkphp  framework  v2(haven't released) 
 */

namespace hawkphp;

class intObj {

    private $_int;

    public function __construct(int $int) {
        $this->_int = $int;
    }

    public function __toString(): string {
        return strval($this->_int);
    }

    public function toInt(): int {
        return $this->_int;
    }

    public function chr(): stringObj {
        return new stringObj(\chr($this->_int));
    }

    public function toString(): stringObj {
        return new stringObj(\strval($this->_int));
    }

    public function decBin(): stringObj {
        return new stringObj(\decbin($this - _int));
    }

}