function foo1() { return NAN * NAN; } function foo2() { return NAN * 2; } function foo3() { return INF * NAN; } function foo4() { return 2.0 * INF; } function foo5() { return INF * INF; } function foo6($a) { return $a * 2.0; } var_dump(foo1()); var_dump(foo2()); var_dump(foo3()); var_dump(foo4()); var_dump(foo5()); var_dump(foo6(3.1));
return $x | $x; } function foo5($x) { return -1 | $x; } function foo6($x, $y, $z) { return $x & $y | $x & $z; } function foo7($x, $y, $z) { return $y & $x | $x & $z; } function foo8($x, $y, $z) { return $x & $y | $z & $x; } function foo9($x, $y, $z) { return $y & $x | $z & $x; } var_dump(foo1()); var_dump(foo2()); var_dump(foo3(4)); var_dump(foo4(4)); var_dump(foo5(4)); var_dump(foo6(4, 6, 7)); var_dump(foo7(4, 6, 7)); var_dump(foo8(4, 6, 7)); var_dump(foo9(4, 6, 7));
echo __NAMESPACE__ . "\n"; } function foo2() { echo __NAMESPACE__ . "\n"; } function foo5() { echo __NAMESPACE__ . "\n"; } } namespace A\B\C { foo(); foo2(); foo3(); foo4(); foo5(); function foo4() { } } namespace A\B\C\D { function foo() { echo __NAMESPACE__ . "\n"; } function foo2() { echo __NAMESPACE__ . "\n"; } function foo5()
return $x - $x + 3; } function foo5($x) { return $x + 3 - $x; } function foo6($x) { return 0 - $x; } function foo7($x) { return $x - 0; } function foo8($x) { return $x - 1; } function foo9($x) { return 1 - $x; } var_dump(foo1(5, 2)); var_dump(foo2(1, 2)); var_dump(foo3(-3)); var_dump(foo4(5)); var_dump(foo5(5)); var_dump(foo6(-3)); var_dump(foo7(3)); var_dump(foo8(4)); var_dump(foo9(-2));
} function foo6() { return 4.4 - INF; } function foo7() { return INF - INF; } function foo8() { return NAN - INF; } function foo9() { return INF - NAN; } function foo10(double $a) { return $a - $a; } var_dump(foo1()); var_dump(foo2()); var_dump(foo3()); var_dump(foo4(3.1)); var_dump(foo5()); var_dump(foo6()); var_dump(foo7()); var_dump(foo8()); var_dump(foo9()); var_dump(foo10(NAN));
<?php function foo1($a, $b) { return $a - 4 + ($b - 9); } function foo2($a, $b) { return $a - 3 + 7; } function foo3($a, $b) { return $a - 3 - 7; } function foo4($a, $b) { return $a - 4 + ($b + 9); } $vals = array(array(0, 0), array(1, 1), array(-3, 5), array(5, -3), array(20, -50), array(20, 0)); foreach ($vals as list($a, $b)) { var_dump(foo1($a, $b)); var_dump(foo2($a, $b)); var_dump(foo3($a, $b)); var_dump(foo4($a, $b)); }
{ return $y * $x + $z * $x; } function foo9($x, $y) { return $x * 3 * ($y * 7); } function foo10($x) { return 3 * $x * 7; } function foo11($x) { return $x * 8; } function foo12($x) { return $x * -8; } var_dump(foo1()); var_dump(foo2(6)); var_dump(foo3(6, 2)); var_dump(foo4(-12)); var_dump(foo5(2, 1, 5)); var_dump(foo6(2, 1, 5)); var_dump(foo7(2, 1, 5)); var_dump(foo8(2, 1, 5)); var_dump(foo9(2, 5)); var_dump(foo10(2)); var_dump(foo11(7)); var_dump(foo12(3));
} function foo2() { $x = 5; $y = false; return $x xor $y; } function foo3() { $x = 5; $y = 5; return $x ^ $y; } function foo4($x, $y) { return $x ^ $y; } function foo5($x) { return ~$x; } function foo6($x) { return !$x; } var_dump(foo1()); var_dump(foo2()); var_dump(foo3()); var_dump(foo4(3, 5)); var_dump(foo5(1)); var_dump(foo6(5));