Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Rekurencja w klasie
-greg712-
post
Post #1





Goście







Witam serdecznie,
Mam problem z ukończeniem pewnego ćwiczenia, opierającego się na wyliczeniu silni rekurencyjnie, poniżej kawałek kodu:

  1. private function SilniaR(){
  2. return $this->SilniaR($this->argument - 1) * $this->argument;
  3. }


Przy próbie otwarcia tego ćwiczenia, wyrzuca mi:
Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 261904 bytes) in C:\xampp\htdocs\learning\zad1.php on line 18

Linia 18 to akurat ten return. Prośba o pomoc (IMG:style_emoticons/default/wink.gif)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
-greg712-
post
Post #2





Goście







@ShadowD - ten, który definiuje już po wyjściu z klasy, teraz akurat 6.

  1. $s1 = new Silnia(6);
  2. $s1->Wyswietl();
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 22:31