How does PHP's list function work?

VothRoyamma

New Member
After recently answering a couple of questions here on SO that involved utilizing PHP's \[code\]list\[/code\] function, I wondered, "how in the world does that function actually work under the hood?". I was thinking about something like using \[code\]func_get_args()\[/code\] and then iterating through the argument list, and that's all nice and peachy, but then how in the world does the assignment part work?\[code\] list(...) = array($x, $y, $z);\[/code\]isn't this ^ evaluated first? So to be precise, my question is how is the \[code\]list\[/code\] function able to create scoped variables which get assigned to the not-yet evaluated array?
 
Back
Top