3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "Some numbers: one: 1; two: 2; three: 3 end"; $ten = 10; $newstring = preg_replace_callback( '/(\\d+)/', function($match) use ($ten) { return (($match[0] + $ten)); }, $string ); echo $newstring; #prints "Some numbers: one: 11; two: 12; three: 13 end";

preferences:
41.39 ms | 402 KiB | 5 Q