3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $content = <<<TEXT services: {{if passthru("echo 'shell does not like you'")}} vrt_providers_<<suffix>>.task_manager.documents_delete: class: Vrt\TaskManagerBundle\Service\Container\DocumentsDeleteTaskContainer arguments: - %vrt_providers_<<suffix>>.task_manager.documents_delete.config% tags: - { name: vrt.task_manager.task, provider: %vrt_providers_<<suffix>>.name% } {{endif}} TEXT; if (preg_match_all('/{{if .+?}}/s', $content, $matches)) { foreach ($matches[0] as $match) { $match = substr($match, 5, -2); $res = false; @eval('$res = (' . $match . ');'); if ($res) { $content = preg_replace('/{{.+?}}/', '', $content, 2); } else { $content = preg_replace('/{{if.+?endif}}/s', '', $content, 1); } } } echo $content;
based on Hj2H0
Output for 4.3.0, 5.4.42 - 7.2.11
services:
Output for 4.3.1 - 5.4.41
shell does not like you services: