Polyglot function to sum all the numbers in an array in Javascript and PHP
Interesting question.

You are trying to avoid poisoning the window object.. Now consider writing several functions like this. You just moved the poisoning from window to $vars. I would not do this because it reduces readability a lot.

$vars['args'][$vars['i']] should be in a helper variable to increase readability. (Regardless of whether you keep $vars)

I would have put this in a function called get_array_length:
$javascript ? $vars['args'][$vars['i']].length : count($vars['args'][$vars['i']]);

Then I would change the top to

if( $javascript = '\0' == "\0" )
{
    $vars = new Object();
    $vars['args'] = arguments;
}
else
{
    $vars = Array();
    $vars['args'] = func_get_args();
}
$vars['l'] = get_array_length($vars['args'])


Still, all in all because you need to maintain compatibility this is okay as an art excercise but this is by no means (because of  it's nature) production or high quality code.