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}, $notification->message); } } echo $tst;
Output for 5.0.4 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined variable: notification in /in/mff8q on line 16 Notice: Trying to get property of non-object in /in/mff8q on line 16
Output for hhvm-3.12.0
Notice: Undefined variable: notification in /in/mff8q on line 16 Notice: Cannot access property on non-object in /in/mff8q on line 16
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.0.0 - 5.0.3
Notice: Undefined variable: notification in /in/mff8q on line 16 Notice: Trying to get property of non-object in /in/mff8q on line 16
Output for 4.3.0 - 4.4.9
Notice: Undefined variable: notification in /in/mff8q on line 16