1.2.708. Mistaken Concatenation

A unexpected structure is built for initialization. It may be a typo that creates an unwanted expression.

<?php

// This 'cd' is unexpected. Isn't it 'c', 'd' ?
$array = array('a', 'b', 'c'. 'd');
$array = array('a', 'b', 'c', 'd');

// This 4.5 is unexpected. Isn't it 4, 5 ?
$array = array(1, 2, 3, 4.5);
$array = array(1, 2, 3, 4, 5);

?>

1.2.708.1. Specs

Short name

Arrays/MistakenConcatenation

Rulesets

All, Coding conventions

Exakat since

1.0.8

PHP Version

All

Severity

Major

Time To Fix

Instant (5 mins)

Precision

Very high

Features

array, concatenation

Available in

Entreprise Edition, Exakat Cloud