0

After updating the web app with Instagram and twitter client id, secret and tokens,

I encountered parser and syntax error on line 1 of the following script. I suspect there is a PHP version conflict. How do I fixe this? Thanks.

function stream_for($resource = '', array $options = [])
{
if (is_scalar($resource)) {
    $stream = fopen('php://temp', 'r+');
    if ($resource !== '') {
        fwrite($stream, $resource);
        fseek($stream, 0);
    }
    return new Stream($stream, $options);
}
iamthewalrus
  • 77
  • 1
  • 7

1 Answers1

2

your function should be

function stream_for($resource = '', $options = array()){
//rest here
}

but yours is valid for 5.4.0+ (Released: 01 March 2012)

  • Thanks. That did the trick. So looks like I would need to manually update the syntax for all the scripts of this web app... I am not a PHP guy, just picking up this for an one time assignment. – iamthewalrus Nov 12 '16 at 02:25