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

    [oop] nessun errore segnalato?

    ragazzi in una mia classe richiamo uno funzione private attraverso una variabile nel senso faccio:

    $this->$nameOfFunction();

    è normale che anche se faccio chiamare una funzione inventata (che non esiste nella classe) il php non fa nessun errore ?

    ovviamente error_reporting(E_ALL);

  2. #2
    Codice PHP:
    <?php 

    class Test {
        function 
    test1() {
            
    $nameOfFunction 'test2';
            
    $this->$nameOfFunction();
        }
    }

    $test = new Test();
    $test->test1();

    ?>
    Fatal error: Call to undefined method Test::test2() in test.php on line 6

  3. #3
    nvm

    sbagliato io

    thx

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.