You are here: Re: constant « PHP Language « IT news, forums, messages
Re: constant

Posted by Jean Pierre Daviau on 12/20/07 18:59

With object flush it seems to work.

<?php

class Registre {

private static $leRegistre = array();
private static $tmp = array();

public static function getProperty($val) {
$num = array_search($val, self::$leRegistre);
return self::$leRegistre[$num];
}

public static function getRegistre() {

return self::$leRegistre;
}

public static function popRegistre($val) {
ob_start();
$i = 0;
$num = array_search($val, self::$leRegistre);
foreach(self::$leRegistre as $key=>$val) {
if($key == $num) continue;
self::$tmp[$i] = $val;
$i++;
}

self::$leRegistre = self::$tmp;
self::$tmp = null;
ob_flush();
}

public static function pushRegistre($value) {
self::$leRegistre[] = $value;
print_r(self::$leRegistre);
}
}


class info1{
public $_INumber;
public $members;
public $methods;

function __construct() {
Registre::pushRegistre(__CLASS__ . ' #' . rand());
}

function __destruct() {
Registre::popRegistre($this->unique_ID);
}
}

$a = new info1();
$b = new info1();

$a = null;
echo "-----\n";
print_r(Registre::getRegistre()) ;
echo "-----\n";

?>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация