Interactive Docker image for testing PHP Immutability RFC
311
See details about RFC at https://wiki.php.net/rfc/immutability
Run interactive PHP shell with docker run --rm -t -i zantolov/php-immutable-docker and paste this example:
<?php
immutable class Email {
public $email;
public function __construct ($email) {
// validation
$this->email = $email;
}
}
$email = new Email("[email protected]");
$email->email = "[email protected]"; // Call will result in Fatal Error
Execute code with CTRL + D
Content type
Image
Digest
Size
272 MB
Last updated
almost 10 years ago
docker pull zantolov/php-immutable-docker