You are here: Re: Butt ugly « PHP Programming Language « IT news, forums, messages
Re: Butt ugly

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-----

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация