You've misunderstood. He only uses that (flat) array to populate the key-value array $c. His problem is that PHP oh-so-helpfully converts the string value to an int value. It's actually impossible to have string values as indices of an array when they are parsable as numbers in PHP. One of the many foibles that stem from conflating flat arrays and key-value maps. (For a real fun time, try reading the docs for array_merge.)
Anyway, it's not surprising. /r/PHP doesn't handle criticism well.
Why would you think the third value in ['ab', 'cd', '10', 'gh', '24'] would have a key of '10'? That's the value, not the key.
The docs are quite clear on how this works:
http://php.net/manual/en/control-structures.foreach.php
foreach (array_expression as $value)
vs.
foreach (array_expression as $key => $value)