what in PHP is similar to Actionscript 's "is" operator?

Anonymous
timer Asked: Oct 22nd, 2013
account_balance_wallet $5

Question Description

what in PHP is similar to Actionscript 's "is" operator?


Tutor Answer

Veedeoo
School: Rice University

Hi,

There are not really similar, but both can provide the same results (solution wise).For example, + operator in action script can be demonstrated by simple codes below

trace ( 3 + 1);

Above expression should deliver an aswer of 4. While in PHP the same expression can be written as

echo ( 3 + 1);

However, in PHP parenthesis is not required. So, this will just work fine

echo 3 + 1 ;

While in actionscript, this

trace 3 + 1;

gives us an error.


In the case concatenation, they are similar with the only exemption of the parenthesis.

in actionscript

trace("3" + 1);

PHP

echo ("3" + 1 );

Keep in mind that the the above only 1 is considered as integer. In PHP, it gives you more freedom to change type from one to the other. For example,

$x = "3";
$y = 1 ;

echo ((int)($x) + $y);

gives us an integer 4, while the example before it gives us string 3 concatenated with integer 1.

flag Report DMCA
Review

Anonymous
Tutor went the extra mile to help me with this essay. Citations were a bit shaky but I appreciated how well he handled APA styles and how ok he was to change them even though I didnt specify. Got a B+ which is believable and acceptable.

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors