|
Posted by Ivαn Sαnchez Ortega on 05/27/06 15:50
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Rik G. wrote:
> Coming from an Assembler/C/C++/C# background I got to say this is butt
> ugly:
It's called "operator precedente and automatic type casting":
> <?php
> echo "2 + 2 = " . 2+2; // This will print 4
Explicit operator precedence:
echo ("2 + 2 = " . 2) + 2;
echo ("2 + 2 = 2") + 2;
Wait, there is a sum operator over there, both operands must be
scalar-typed:
echo ( (int) "2 + 2 =2") + 2;
And, if you RTFM about casting a string to integer:
echo ( 2 ) + 2;
- --
- ----------------------------------
IvΓ‘n SΓ‘nchez Ortega -i-punto-sanchez--arroba-mirame-punto-net
http://acm.asoc.fi.upm.es/~mr/
Proudly running Debian Linux with 2.6.15-1-686 kernel, KDE3.5.0, and PHP
5.1.2-1+b1 generating this signature.
Uptime: 14:47:44 up 30 min, 1 user, load average: 0.88, 1.55, 1.32
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
iD8DBQFEeEsj3jcQ2mg3Pc8RAncbAKCAGbEAAgvBM/kyWYPN09nsptoozgCfZLMF
nGAewVd/7NJZGPbHLwUSWhQ=
=B+Vj
-----END PGP SIGNATURE-----
[Back to original message]
|