NOVINKA: Najžiadanejšie rekvalifikačné kurzy teraz s 50% zľavou + kurz AI ZADARMO. Nečakaj, táto ponuka dlho nevydrží! Zisti viac:

PHP - exit

Trieda

Koreň \ Bez triedy

Metóda - exit

(PHP 4, PHP 5, PHP 7)

exit terminates the running script and shows a message if a parameter is passed. It is a language construct and it does not need any parameters.

Shutdown functions, as well as object destructors, are even executed after the exit call.

Procedurálne

  • function exit (int $status, int $status) : void
  • function exit (int $status, int $status) : void

Parametre

NázovDátový typPredvolená hodnotaPopis
$statusint

The message printed on exiting the script.

The number in the range 0-255. 255 is reserved by PHP and shall not be used, 0 means a successful completion of the script.

$statusint

The message printed on exiting the script.

The number in the range 0-255. 255 is reserved by PHP and shall not be used, 0 means a successful completion of the script.

Mávratovej hodnoty

Vracia: void

No value is returned.

Príklady

<?php
    class ICT {
        public function __destruct() {
            echo ("The descructor of the ICT class. ");
        }
    }

    $ict = new ICT();
    exit('The script ends. ');

Súvisiace manuály

        Aktivity