Created
February 10, 2015 23:13
-
-
Save ralphschindler/77ad194e038a198a5a42 to your computer and use it in GitHub Desktop.
What happened when this was suggested many years ago?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// coercive types, as per PersonFactory author's specification | |
class ElePHPant { | |
public $name, $age, $cuteness, $evil; | |
public function __construct(~string $name, ~int $age, ~float $cuteness, ~bool $evil) { | |
$this->name = $name; | |
$this->age = $age; | |
$this->cuteness = $cuteness; | |
$this->evil = $evil; | |
} | |
} | |
// forced types, as per PersonFactory author's specification | |
class ElePHPant { | |
public $name, $age, $cuteness, $evil; | |
public function __construct(string $name, int $age, float $cuteness, bool $evil) { | |
$this->name = $name; | |
$this->age = $age; | |
$this->cuteness = $cuteness; | |
$this->evil = $evil; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment