ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Object Overloading in PHP 5
Subject:   __construct overloading
Date:   2006-07-24 08:25:38
From:   MartinJansen
Response to: __construct overloading

Multiple constructors per class are not supported. You'll have to use something like



<?php
...


public function __construct($p = null) {
if ($p === null) {
echo "hye";
} else {
echo $p . "<br />";
}
}


...
?>


1 to 1 of 1
  1. __construct overloading
    2007-02-19 05:15:53  ambikadevi [View]

1 to 1 of 1