Visualizzazione dei risultati da 1 a 3 su 3

Discussione: __PHP_Incomplete_Class

  1. #1

    __PHP_Incomplete_Class

    PHP4, lavorando con gli oggetti e le sessioni mi trovo che se per debug stampo con print_r() un oggetto restituisce invece di NomeOggetto Object il titolo

    Codice PHP:
    __PHP_Incomplete_Class Object 
    Proprietà e metodi funzionano egregiamente.
    Why?

  2. #2

    ..........

    Ciao.
    Ho trovato questo :
    I've just come accross something interesting relating to storing PHP5 objects in a session. If you don't provide an __autoload(), then you MUST load the class definition before calling session_start(). I guess that when you call session_start(), any objects in the session are unserialized then and there and placed into $_SESSION. If you don't provide the class definition before calling session_start(), your object will get the class __PHP_Incomplete_Class, and you won't be able to use it for anything.
    Penso ti possa essere utile.

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

  3. #3
    Yep, ieri sera avevo trovato la soluzione ma non l'avevo ancora postata.
    RIassumendo, accade se viene lanciato session_start() prima della definizione della classe oggetto.

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 © 2025 vBulletin Solutions, Inc. All rights reserved.