3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $regex = "~%(?:(\d+)[$])?[-+]?(?:[ 0]|['].)?(?:[-]?\d+)?(?:[.]\d+)?[%bcdeEufFgGosxX]~"; $format = 'The %s contains %d monkeys'; $arguments = array(5, 'tree'); if (preg_match_all($regex, $format, $expected) > 0) { print_r($expected); }
Output for 4.3.0 - 7.1.0
Array ( [0] => Array ( [0] => %s [1] => %d ) [1] => Array ( [0] => [1] => ) )