Skip to content

Instantly share code, notes, and snippets.

@MaheKarim
Created May 17, 2019 20:16
Show Gist options
  • Save MaheKarim/21e52adfbca34cf594837b8190f22f76 to your computer and use it in GitHub Desktop.
Save MaheKarim/21e52adfbca34cf594837b8190f22f76 to your computer and use it in GitHub Desktop.
Call to undefined function factorial()
<?php
/**
* Created by PhpStorm.
* User: Mahe
* Date: 18-May-19
* Time: 1:11 AM
*/
include_once "functionsss.php";
$x = 5;
echo "Factorial of {$x} is ".factorial($x);
<?php
/**
* Created by PhpStorm.
* User: Mahe
* Date: 18-May-19
* Time: 1:34 AM
*/
function isEven ($myVar){ // Parameters
if ($myVar%2==0){
return true;
}
return false;
}
function factorialCheck ($myVar){
$result = 1;
for ($i= $myVar; $i>1; $i--){
$result *= $i;
}
return $result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment