PlatformIO and Arduino use essentially the same C++ compiler...
(by which I mean avr-gcc, arm-none-eabi-gcc, xtensa-*-elf-gcc, etc. There may be some version differences, and they may be set up for different C++ "standards", but you shouldn't see any major differences in stuff like basic syntax.)
(Looks like ST has the most 'cutting edge' compiler)
"Arduino 101" Arduino arc-elf32-g++ (ARCompact/ARCv2 ISA elf32 toolchain arc-2016.03-rc2-2-ga657822) 4.8.5
rp2040: arm-none-eabi-g++ (GCC) 10.3.0
AVR DxCore: avr-g++ (GCC) 7.3.0
STM; arm-none-eabi-g++ (xPack GNU Arm Embedded GCC x86_64) 13.2.1 20231009
ESP32-C*: riscv32-esp-elf-g++ (crosstool-NG esp-12.2.0_20230208) 12.2.0
ESP32: xtensa-esp32s3-elf-g++ (crosstool-NG esp-2021r2-patch5) 8.4.0
ESP32s2: xtensa-esp32-elf-g++ (crosstool-NG esp-12.2.0_20230208) 12.2.0
esp32s3: xtensa-esp32s2-elf-g++ (crosstool-NG esp-12.2.0_20230208) 12.2.0
?Again?: xtensa-esp32s3-elf-g++ (crosstool-NG esp-12.2.0_20230208) 12.2.0
xtensa-esp32-elf-g++ (crosstool-NG crosstool-ng-1.22.0-80-g6c4433a) 5.2.0
esp8266: xtensa-lx106-elf-g++ (GCC) 4.8.2
?again?: xtensa-lx106-elf-g++ (crosstool-NG 1.20.0) 4.8.2
AVR "Arduino7": avr-g++ (GCC) 7.3.0
AVR "Arduino5": avr-g++ (GCC) 7.3.0
arm-none-eabi-g++ (GNU Tools for ARM Embedded Processors) 4.8.3 Arduino (Due?):20140228 (release) [ARM/embedded-4_8-branch revision 208322]
Arduino (SAMD): arm-none-eabi-g++ (GNU Tools for Arm Embedded Processors 7-2017-q4-major) 7.2.1 20170904 (release) [ARM embedded-7-branch revision 255204]
Seeed SAMD: arm-none-eabi-g++ (GNU Tools for Arm Embedded Processors 7-2017-q4-major) 7.2.1 20170904 (release) [ARM embedded-7-branch revision 255204]
Adafruit SAMD: arm-none-eabi-g++ (GNU Tools for Arm Embedded Processors 9-2019-q4-major) 9.2.1 20191025 (release) [ARM/arm-9-branch revision 277599\