View Single Post

  #4 (permalink)  
Old 11-30-2006
Dikkie Dik
 
Posts: n/a
Default Re: -> PHP4 Singleton implementation question <-

<snip>
> Then my form works as follows:
> ------------------------------
> <FORM action="<?=$_SERVER['PHP_SELF']?>" method="post">
> <?php
> require_once( "class_welcome.php" ) ;
> if( !$welcome ) {
> $welcome =& Welcome::getInstance() ;
> }


Following the PHP documentation on http://nl3.php.net/static , I would
suggest to replace this last line with a non-referencing one:

$welcome = Welcome::getInstance() ;

As was posted earlier, PHP5 has solved the objects-and-references problem.

Best regards.
Reply With Quote