3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $firstName = 'Marc Jutten'; $str = '{{$firstName}}, {{$productName_67003}}'; if (preg_match_all('/{{\$productName_(\d{1,})}}/', $str, $matches)) { foreach ($matches[1] as $productIdKey => $productId) { $tst = str_replace( $matches[0][$productIdKey], '2 kaarten voor hét Nederlandse muziekfestival: Dutch Valley', $str ); } } if (preg_match_all('/{{\$(.*?)}}/', $tst, $matches)) { foreach ($matches[1] as $varKey => $varName) { $tst = str_replace($matches[0][$varKey], ${$varName}, $tst); } } echo $tst;
Output for 4.3.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
Marc Jutten, 2 kaarten voor hét Nederlandse muziekfestival: Dutch Valley
Output for hhvm-3.10.0

Process exited with code 153.