Trying to use a simple "versioning" system for some hashes, I do the following:
$last_version = '009';
$increment = '001';
$result = $last_version + $increment;
var_dump($result);
I would expect: string(010) but I get int(10) and before I jump into if's and str-pad, I was wondering if there's any other way of conserving the desired format?
? As for your str/int, you're forcing PHP to cast those strings to ints since you're using+`, which is addition.