Example #1
0
<?php

require_once 'src/Primitive.php';
require_once 'src/Scalar.php';
require_once 'src/PArray.php';
require_once 'src/Scalar/PString.php';
require_once 'src/Scalar/PInt.php';
require_once 'src/Scalar/PFloat.php';
require_once 'src/Scalar/PNull.php';
require_once 'src/Helper.php';
$var = primval(1)->add(3000)->mul(primval(3))->numformat();
var_dump(strval($var));
$var = primval('str');
var_dump(strval($var));
$var = primval(1.1)->add(5);
var_dump($var->val());
$var = primval(null);
var_dump(strval($var));
$var = primval([])->push(1)->push(2)->push([3, 4]);
foreach ($var as $v) {
    var_dump($v);
}
var_dump(count($var));
Example #2
0
 public function push($v)
 {
     array_push($this->_, primval($v));
     return $this;
 }