Q:
PHP find output programs (User-defined functions) | set 3
belongs to collection: PHP Find Output Programs
PHP Find Output Programs
- PHP find output programs (basics) | set 1
- PHP find output programs (basics) | set 2
- PHP find output programs (basics) | set 3
- PHP find output programs (Superglobals) | set 1
- PHP find output programs (conditional statements) | set 1
- PHP find output programs (conditional statements) | set 2
- PHP find output programs (conditional statements) | set 3
- PHP find output programs (switch Statement) | set 1
- PHP find output programs (switch Statement) | set 2
- PHP find output programs (switch Statement) | set 3
- PHP find output programs (Operators) | set 1
- PHP find output programs (Operators) | set 2
- PHP find output programs (Operators) | set 3
- PHP find output programs (Loops) | set 1
- PHP find output programs (Loops) | set 2
- PHP find output programs (Loops) | set 3
- PHP find output programs (Loops) | set 4
- PHP find output programs (Arrays) | set 1
- PHP find output programs (Arrays) | set 2
- PHP find output programs (Arrays) | set 3
- PHP find output programs (User-defined functions) | set 1
- PHP find output programs (User-defined functions) | set 2
- PHP find output programs (User-defined functions) | set 3
- PHP find output programs (String Functions) | set 1
- PHP find output programs (String Functions) | set 2
- PHP find output programs (Number Functions) | set 1
- PHP find output programs (Math Functions) | set 1
- PHP find output programs (Math Functions) | set 2
- PHP find output programs (Date and Time) | set 1
- PHP find output programs (define Constant) | set 1
- PHP find output programs (static variables, classes, methods) | set 1
- PHP find output programs (static variables, classes, methods) | set 2
- PHP find output programs (Regular Expressions) | set 1
- PHP find output programs (Exceptions) | set 1
- PHP find output programs (Exceptions) | set 2
- PHP find output programs (Filters) | set 1
- PHP find output programs (Filters) | set 2
- PHP find output programs (JSON) | set 1
- PHP find output programs (const Keyword) | set 1
- PHP find output programs (Class & Objects) | set 1
- PHP find output programs (Class & Objects) | set 2
- PHP find output programs (Class & Objects) | set 3
- PHP find output programs (Constructors and Destructors) | set 1
- PHP find output programs (Constructors and Destructors) | set 2
- PHP find output programs (Constructors and Destructors) | set 3
- PHP find output programs (Inheritance) | set 1
- PHP find output programs (Inheritance) | set 2
- PHP find output programs (Inheritance) | set 3
Answer 1:
Output:
Explanation:
The above program will generate syntax error, because of the below statement.
$VAR = $A.at(0);
Here, we used at(), which is not a built-in function in PHP.
Answer 2:
Output:
Explanation:
The above program will generate syntax error because we created function fun() with parameter $VAL, which looks like a pointer. But PHP does not support pointers.
Answer 3:
Output:
Explanation:
The above program will generate the compile-time error because here we defined a function add() without curly brasses, it is mandatory to use curly brasses in the definition of function in PHP.
Answer 4:
Output:
Explanation:
In the above program we defined two functions fun() and add().
The add() function is used to return the sum of two specified numbers, and fun() function is used to print the table of a specified number.
Now look to the function call.
FUN(add(printf("AB"),printf("CD")));
In the above function call FUN(), the printf("AB") will print "AB" and return 2, similarly printf("AB") will print "AB" and return 2. Then the final function call looks like:
FUN(add(2,2)); FUN(4);
The table of 4 will be printed on the webpage.
Answer 5:
Output:
Explanation:
In the above program, function fun() will print the table of the specified number. The function log(10) will return 2. Then the function call will be FUN(2). Then the table of 2 will be printed on the webpage.
need an explanation for this answer? contact us directly to get an explanation for this answer