Visualizzazione dei risultati da 1 a 6 su 6
  1. #1

    A pro di unset($obj) ........

    Ciao.
    Vorrei conoscere la vs opinione riguardo
    l'uso di unset su i vari oggetti creati in uno
    script (naturalmente quando hanno finito il
    loro compito )
    Esempio:
    Codice PHP:
    $obj = new foo();
    // Fa qualcosa
    unset($obj); 
    Nel senso è una best pratice
    secondo voi ?

    Without faith, nothing is possible. With it, nothing is impossible
    http://ilwebdifabio.it

  2. #2
    Ho trovato quetto:
    codice:
    unset($object);
    unset($GLOBALS["object"]);
    Sistemi di allarme, telecamere, autoradio, video proiettori e altri prodotti tecnologici: fedom.it

  3. #3

    ..........

    Dove dove
    Anche se non capisco l'uso di GLOBAL.

    Resto in attesa del link .........




    Without faith, nothing is possible. With it, nothing is impossible
    http://ilwebdifabio.it

  4. #4

    .....

    A pro ho trovato questo:
    Codice PHP:
    <?php

    class User
    {

         function 
    User_login ( ... )
         {...}

         function 
    User_logout $greeting )
         {
            
             ...
             foreach ( 
    array_keys get_object_vars ( &$this ) ) as $val)
             {    unset( 
    $this->$val );    }
             
    $this->greeting $greeting;
             ...

         }

    }

    ?>

    qui



    Without faith, nothing is possible. With it, nothing is impossible
    http://ilwebdifabio.it

  5. #5
    Sistemi di allarme, telecamere, autoradio, video proiettori e altri prodotti tecnologici: fedom.it

  6. #6

    ........

    Merci


    Without faith, nothing is possible. With it, nothing is impossible
    http://ilwebdifabio.it

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.