0

I'm creating a php script to download modify and install underscores from github, but I have problem with heredocs stntax, and this isn't the first time. I can't understand why it doesn't work. It returns a end of file error, can anyone help me understand why?

#!/usr/bin/php
<?php


if($argc < 7) {
  echo <<<ERROR_INPUT
  syntax:
  set.php -n [theme_name] -d [domain_name] -t [target]
  ERROR_INPUT;
  exit();
}

$catch = false;
foreach($argv as $arg) {
$target = '';
  if($arg === '-t') {
    $catch = true;
    continue;
  }

  if($catch === true){
    $target = $arg;
    $catch = false;
    break;
  }


}
exec("git clone https://github.com/Automattic/_s $target");
Salvio
  • 100
  • 2
  • 15
  • 1
    `It is very important to note that the line with the closing identifier must contain no other characters, except a semicolon (;). That means especially that the identifier may not be indented` http://php.net/manual/en/language.types.string.php – chris85 Apr 22 '17 at 21:57
  • Possible duplicate of [Must EOT be at the bebinning in the line?](http://stackoverflow.com/questions/43112033/must-eot-be-at-the-bebinning-in-the-line) – chris85 Apr 22 '17 at 21:59
  • Thanks, Now I have definitely understood the problem... – Salvio Apr 22 '17 at 22:23

0 Answers0