I have a problem using the IntlDateFormatter class.
The following code gives different results if it is executed by apache or cli
<?php
$obj_formato = new IntlDateFormatter(setlocale(LC_TIME, 0), null, null);
$obj_formato->setPattern("MMM");
for($i=1; $i<13; $i++) {
print $obj_formato->format(strtotime("2022-$i-01")) . PHP_EOL;
}
Apache: ene. feb. mar. abr. may. jun. jul. ago. sept. oct. nov. dic.
CLI: ene. feb. mar. abr. may. jun. jul. ago. sep. oct. nov. dic.
The result by CLI returns "Sept.", by Apache it returns "Sep." It is also the only month where the returned result contains 4 letters
I am using PHP 7.4.33
Any help?
I'm trying to get the short names of the months without using strftime()