3v4l.org

run code in 300+ PHP versions simultaneously
<?php function extractVars($pattern){ //Extract if function $array_vars = []; $rgx = '/^(?<startOfS>.*?)\{=IF\((device=mobile|audience IN\(.*?\)),(.*?)\):(.*?)\}(?<endOfS>.*?)$/'; preg_match_all($rgx, $pattern, $matches, PREG_SET_ORDER, 0); print_r($matches); return $array_vars; } $var = extractVars(" Get The Best Shoes At The Best Price. {=IF(device=mobile,Free Shipping on Mobile Orders!):Buy Now!}"); print_r($var);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [0] => Get The Best Shoes At The Best Price. {=IF(device=mobile,Free Shipping on Mobile Orders!):Buy Now!} [startOfS] => Get The Best Shoes At The Best Price. [1] => Get The Best Shoes At The Best Price. [2] => device=mobile [3] => Free Shipping on Mobile Orders! [4] => Buy Now! [endOfS] => [5] => ) ) Array ( )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
56.32 ms | 402 KiB | 8 Q