PHP Conference Fukuoka 2025

Voting

: max(four, zero)?
(Example: nine)

The Note You're Voting On

tyler AT canfone [dot] COM
17 years ago
@ php at mikebird

You can pass arguments to your constructor through your getInstance method, assuming you are running php5.

public static function getInstance($params = null) {
if (self::$objInstance == null) {
$strClass = static::getClass();
self::$objInstance = new $strClass($params);
}
return self::$objInstance;
}

This would pass the params to your constructor. Love for php.

<< Back to user notes page

To Top