Hi.

A chunk in the RFC:

    abstract class Constraint {
        public $groups;

        public function __construct() {
            unset($this->groups);
        }

        public function __get($name) {
            // Will get called on first access, but once initialized.
            $this->groups = ...;
        }
    }

Interesting! new to me.

Maybe someday we will have this one:

    abstract class Constraint {
        public lazy $groups;

        public function __construct() {
            // no need to do this:
            // unset($this->groups);
        }

        public function __get($name) {
            // Will get called on first access, but once initialized.
            $this->groups = ...;
        }
    }

Regards,
Hendra Gunawan.

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to