Uploaded image for project: 'Aptana Studio'
  1. Aptana Studio
  2. APSTUD-8128

PHP syntax checker incorrectly reports PHP 'short' array usage as "Syntax Error"

    Details

    • Type: Bug
    • Status: Open
    • Priority: Low
    • Resolution: Unresolved
    • Affects Version/s: Aptana Studio 3.4.2
    • Fix Version/s: None
    • Component/s: PHP
    • Labels:
      None

      Description

      Aptana Studio reports this php code as syntactically correct:

      	<php?
      		$YY = array(
      			'A' => array(
      				'B'  => "12345",
      				'C'  => "12345",
      			),
      		);
      	?>
      

      but this version of it with a "Syntax Error"

      	<?php
      		$XX = [
      			'A' => [
      				'B'  => "12345",
      				'C'  => "12345",
      			],
      		];
      	?>
      

      per http://us1.php.net/manual/en/language.types.array.php, BOTH are acceptable

      "As of PHP 5.4 you can also use the short array syntax, which replaces array() with []."

      		<?php
      		$array = array(
      		    "foo" => "bar",
      		    "bar" => "foo",
      		);
       
      		// as of PHP 5.4
      		$array = [
      		    "foo" => "bar",
      		    "bar" => "foo",
      		];
      		?>
      

        Attachments

          Activity

            People

            • Assignee:
              pinnamuri Praveen Innamuri (Inactive)
              Reporter:
              pgnd pgnd
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Git Source Code