Для получения полного доступа

PHP 7. Anonymous Classes

Most probably PHP 7 is going to have anonymous classes. Above is my use case for these. What are yours?

Would be glad to receive some ideas as revisions.

$image = new class {
	public width  = null;
	public height = null;

	public function __construct($filename) {
		list($width, $height) = getimagesize($filename);

		$this->width  = $width;
		$this->height = $height;

	public function resize($width, $height) {
		// some code

$image->resize(500, 500);

Чтобы увидеть комментарии, нужно быть участником сообщества