Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

array() isn't a function, it's just PHP array literal syntax.

    $x = array("a" => 100); // legal
    $y = my_func("a" => 100); // illegal


Yeah, call_user_func('strlen', 'hello world') works but call_user_func('array', 'hello world') does not. But for ugly syntax, it's hard to beat the $ sigil being required everywhere for no reason at all (unlike Perl where it actually did something).


$vars remind me of programming mIRC.


You're right, I was a bit hasty and didn't consider that. It sure does look like a function though, where other languages typically use {} or something similar.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: