2009/7/2 troels knak-nielsen <troel...@gmail.com>:
> [snip] ... - I don't remember ever
> seen __construct() called directly.

Its commonly done when extending reflection for example, or to
populate the Exception class constructor when extending it:

<?php
    class TestException extends Exception
    {
        public function __construct($code, $message)
        {
            $this->code = (integer) $code;

            parent::__construct($message);
        }
    }
?>

Or more complex constructors without having to re-implement their
logic / handling of constructing the object.




-- 
regrads,

Kalle Sommer Nielsen
ka...@php.net

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

Reply via email to