3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "706AN=0,503-PP=0,504-PP=0,519=0,606BOX=0,417=2"; echo preg_replace( '#([^=]+)=(\d+),?#', "Code \$1 has quantity \$2\n", $string );
Output for 8.1.32 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
Code 706AN has quantity 0 Code 503-PP has quantity 0 Code 504-PP has quantity 0 Code 519 has quantity 0 Code 606BOX has quantity 0 Code 417 has quantity 2

preferences:
60.96 ms | 857 KiB | 4 Q