3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function fox( $a) { return $a . 'fox!'; } function dog( $b) { return $b . 'dog!'; } $a = 'A'; $b = 'B'; $string = 'The quick brown {{fox($a);}} jumped over the lazy {{dog($b);}}.'; $regex = '/{{([^}]+)+}}/e'; $result = preg_match_all( $regex, $string, $matches); var_dump( $matches);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(2) { [0]=> array(2) { [0]=> string(12) "{{fox($a);}}" [1]=> string(12) "{{dog($b);}}" } [1]=> array(2) { [0]=> string(8) "fox($a);" [1]=> string(8) "dog($b);" } }