3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $content = <<<TEXT services: {{if !`echo poof!`}} 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 e3dpZ
Output for 4.3.0, 5.4.42 - 7.2.0
services: 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% }
Output for 4.3.1 - 5.4.41
services: