option 1 needs a semicolon as final sign at the end of the php command, means:
eval("\arr = $text;");
I suspect, option 2 analogously needs this semicolon, too.