3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = '44-xkIolspO'; sscanf($text, '%d-%s', $one, $two); var_dump($one, $two); unset($one, $two); [$one, $two] = sscanf($text, '%d-%s'); var_dump($one, $two); unset($one, $two); [$one, $two] = explode('-', $text); var_dump($one, $two); unset($one, $two); [$one, $two] = str_getcsv($text, '-'); var_dump($one, $two); unset($one, $two); [$one, $two] = preg_split('/-/', $text); var_dump($one, $two); unset($one, $two);
Output for 8.4.1 - 8.4.12
int(44) string(8) "xkIolspO" int(44) string(8) "xkIolspO" string(2) "44" string(8) "xkIolspO" Deprecated: str_getcsv(): the $escape parameter must be provided as its default value will change in /in/WpeGA on line 17 string(2) "44" string(8) "xkIolspO" string(2) "44" string(8) "xkIolspO"
Output for 7.2.20, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25
int(44) string(8) "xkIolspO" int(44) string(8) "xkIolspO" string(2) "44" string(8) "xkIolspO" string(2) "44" string(8) "xkIolspO" string(2) "44" string(8) "xkIolspO"

preferences:
79.82 ms | 408 KiB | 5 Q