LoginSignup
0
0

More than 5 years have passed since last update.

【PHP構文理解度クイズ】このコードの中で構文エラーになる行はどこ?

Posted at

10行からなる次のPHPコードを実行すると必ず「Parse error: syntax error」になるが、このエラーは何行目で発生するか? なお、PHPのバージョンは7.1.8とする。

<?php
$a = [1, 2, 3];
if (3 === count($a)) {
    foreach ($a as $x => $y):
        echo 'A','B','C' . $x;
        preg_match(/[0-9]+/, $y);
    endforeach;
} elseif ($b()()[0])
    return 2017-10-21;
PHP is a popular general-purpose scripting language
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0