Sign inSign up

zantolov/php-immutable-docker

By zantolov

•Updated almost 10 years ago

Interactive Docker image for testing PHP Immutability RFC

Image
0

311

zantolov/php-immutable-docker repository overview

⁠Docker for testing PHP Immutability

⁠RFC

See details about RFC at https://wiki.php.net/rfc/immutability⁠

⁠Usage

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

Tag summary

Content type

Image

Digest

Size

272 MB

Last updated

almost 10 years ago

docker pull zantolov/php-immutable-docker