<slide>
<title>PHP 8.4: Real Life Example with Property Hooks</title>

<example><![CDATA[<?php
class ezcMailImapTransportOptions 
{
    protected $properties;

    public function __construct( array $options = array() )
    {
        $this->listLimit = 0;
    }

    public function __set( $name, $value )
    {
        switch ( $name ) {
            case 'listLimit': 
                if ( !is_int( $value ) || $value < 0 ) {
                    throw new ezcBaseValueException( $name, $value, 'int >= 0' );
                }
                $this->properties[$name] = $value;
                break;
        }
    }

    // …
}
?>]]></example>

</slide>
