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

Home » Imported messages » comp.lang.php » Novice Question
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Novice Question [message #180589 is a reply to message #180588] Mon, 04 March 2013 00:52 Go to previous messageGo to previous message
Thomas 'PointedEars'  is currently offline  Thomas 'PointedEars'
Messages: 701
Registered: October 2010
Karma:
Senior Member
Gregor Kofler wrote:

> Am 03.03.2013 23:10, David Heller meinte:
>> I'm doing some maintenance/upgrade of some old php4.3 code and I ran
>> across the following code snippet:
>> $gvns = (array)$gvns;
>> What it exactly is happening here? what does (array) mean?
>> never seen anything like this before.
>
> Type casting.

ACK.

> (It's the same as $gvns = array($gvns); )

Evidently it is not.

$ php -r 'class C {}; print_r((array) new C()); print_r(array(new C()));'
Array
(
)
Array
(
[0] => C Object
(
)

)


PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: XML error when accessing a certain method of a wsdl service
Next Topic: Dynamically change video URLs
Goto Forum:
  

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

Current Time: Fri Nov 22 09:39:54 GMT 2024

Total time taken to generate the page: 0.05103 seconds