Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP braces and conditional

Tags:

php

braces

What does this line mean?

if ( ${fun("str1")} (fun("str2"), ${fun("str3")}) )

Evaluate function returning_value_for_str1_of_fun()_name with the parameters return value for str2 and variable with name return_value_for_str3 ?

like image 606
astrophonic Avatar asked Oct 15 '12 12:10

astrophonic


People also ask

What are the 4 conditional statements in PHP?

if statement - executes some code if one condition is true. if...else statement - executes some code if a condition is true and another code if that condition is false. if...elseif...else statement - executes different codes for more than two conditions. switch statement - selects one of many blocks of code to be ...

Why conditional statements are used in PHP?

PHP allows you to choose what action to take based on the result of a condition.

Can you put an if statement inside an if statement PHP?

We can use if statements inside if statements. These statements are called Nested If Statements.

How many PHP conditional statements are there?

In PHP, there are 4 different types of Conditional Statements.


1 Answers

This tests the return value of the function, whose name is the value in the variable named fun("str1"), and given the arguments fun("str2") and the value of the variable named fun("str3").

Example:

If fun("str1") equals "x", fun("str2") equals 34, and fun("str3") equals "y", then the statement would look like:

if ( $x (34, $y) )
like image 195
Tim Cooper Avatar answered Oct 04 '22 10:10

Tim Cooper