<?php
define("NAME", "VALUE");
function fizzBuzz(){
for($i = 1; $i <= 100; $i++){
if ($i % 3 == 0) {
echo 'Fizz';
}
if ($i % 5 == 0) {
echo 'Buzz';
}
if (!($i % 3 == 0) && !($i % 5 == 0)) {
echo $i;
}
echo "\n";
}
}
abstract class Vector2{
protected $x;
protected $y;
function __construct($x, $y){
$this->x = $x;
$this->y = $y;
}
abstract function toString();
}
class Vector3 extends Vector2{
private $z;
function __construct($x = 0, $y = 0, $z = 0){
parent::__construct($x, $y);
$this->z = $z;
}
function toString(){
return "($this->x, $this->y, $this->z)";
}
function Hoge(){
return true;
}
}
$origin = new Vector3();
echo $origin->toString();
$vector3String = "Vector3";
$toStringString = "toString";
$one = new $vector3String(1, 1, 1);
echo $one->$toStringString();
?>