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
piotrooo89
post
Post #2


Newsman


Grupa: Moderatorzy
Postów: 4 005
Pomógł: 548
Dołączył: 7.04.2008
Skąd: Trzebinia/Kraków




hint: wpisz w google silnia i zaimplementuj algorytm.
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 26.12.2025 - 00:29