3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (version_compare(PHP_VERSION, '5.4.0') >= 0){ preg_match_all('/(?:\e\[(.*?)m|(\x08))/',"foob\e[31;41ma\e[0mr\x08\x08\x08 ", $matches, PREG_OFFSET_CAPTURE); } else { preg_match_all('/(?:\\\e\[(.*?)m|(\x08))/','foob\e[31;41ma\e[0mr\x08\x08\x08 ', $matches, PREG_OFFSET_CAPTURE); } var_dump($matches);

preferences:
27.97 ms | 406 KiB | 5 Q