FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Something I have never seen before
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Something I have never seen before [message #169466 is a reply to message #169460] Tue, 14 September 2010 09:24 Go to previous messageGo to previous message
Captain Paralytic is currently offline  Captain Paralytic
Messages: 204
Registered: September 2010
Karma:
Senior Member
On 14 Sep, 01:07, sheldonlg <sheldonlg> wrote:
> In all my years of programming here is something I have never seen
> before (that actually happened in a program:
>
> $b = array('5', '3');
> $a = (count($b) + 1)/2;
> print 'count = ' . count($b) . '<br>';
> print 'a = ' . $a;
>
> Output:
> =======
> count = 2
> a = 1.5
>
> I just don't understand how this is possible, that a is not one.
>
> --
> Shelly

I agree it is pretty amazing that you have found some programming
lines that actually give the correct output!

I have seen it before, once or twice ;-)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Function that returns name of itself?
Next Topic: Last element in an array?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 19:53:48 GMT 2024

Total time taken to generate the page: 0.06457 seconds