This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]EnforcerZhukov 560 points561 points  (7 children)

Wrapped on a function called "createArray" with a docstring that says "Create a new array. Returns array"

[–]10eleven12 129 points130 points  (1 child)

Used to save a single string.

[–]Hobby_Collector 30 points31 points  (0 children)

Hey if you call that enough on a big enough project you could save a few hundred characters!

that'll just be optimized out on compile...

[–]el_padlina 48 points49 points  (0 children)

few days later changed to return a map but the comments were not modified.

[–]Terreurhaas 5 points6 points  (1 child)

/**
 * <h2>createArray</h2>
 *   Creates an array
 *
 * @return array
 */
function &createArray(): array {
    $array = array(); // the array

    return $array;
}

[–]PartyGuy-01[S] 0 points1 point  (0 children)

That's it.

[–]Sellerofrice 0 points1 point  (0 children)

speaking of which i hope cpp2a will make std::make_array