recursive - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of recursive.php

  1. <?php
  2.     function rec(&$a,&$b)
  3.     {
  4.         var_dump($a."\br");
  5.         $a += 1;
  6.         if ($a < $b)
  7.         {
  8.             return rec($a,$b);
  9.         }
  10.         else
  11.         {
  12.             var_dump($a."\br");
  13.         }
  14.     }
  15. $c = 0;
  16. $d = 10;
  17. rec($c,$d);
File Description
  • recursive
  • PHP Code
  • 12 May-2022
  • 254 Bytes
You can Share it: