3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $tags = "-10 ayanami_rei"; preg_match_all('/-\d+/', $tags, $matches); var_dump($matches[0]); if ($matches[0]){ $loop = substr($matches[0],1,strlen($matches[0])); $tags = str_replace("{$matches[0]} ","",$tags); $loop = ($loop >=11 ? 10 : $loop); } else { $loop = 1; } for ($i = 1; $i <= $loop; $i++) { echo $tags; }
based on L4OuD
Output for 5.6.0 - 7.3.0alpha1
array(1) { [0]=> string(3) "-10" } Warning: strlen() expects parameter 1 to be string, array given in /in/T5CSc on line 7 Warning: substr() expects parameter 1 to be string, array given in /in/T5CSc on line 7 Notice: Array to string conversion in /in/T5CSc on line 8