3v4l.org

run code in 300+ PHP versions simultaneously
<?php $code = "<?php /* * This file is part of the symfony package. * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com> * (c) 2004-2006 Sean Kerr <sean@code-box.org> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * sfAction executes all the logic for the current request. * * @author Fabien Potencier <fabien.potencier@symfony-project.com> * @author Sean Kerr <sean@code-box.org> * * @method sfWebController getController() * @method sfWebResponse getResponse() */ abstract class sfAction extends sfComponent { protected \$security = []; /** * Initializes this action. * * @param sfContext \$context the current application context * @param string \$moduleName the module name * @param string \$actionName the action name */ public function initialize(\$context, \$moduleName, \$actionName) { parent::initialize(\$context, \$moduleName, \$actionName); // include security configuration if (\$file = \$context->getConfigCache()->checkConfig('modules/'.\$this->getModuleName().'/config/security.yml', true)) { require \$file; } } }"; $replaceRegex = '/^(?:<pre><code(?: [^>]+)?>|<code><span(?: [^>]+)?>\s*)(.*?)(?:<\/code><\/pre>|\s*<\/span>\s*<\/code>)$/s'; $splitRegex = '/(\r\n|\n|\r|<br \/>)/'; $content = preg_replace($replaceRegex, '$1', highlight_string($code, true)); $content = preg_split($splitRegex, $content); echo sprintf("Expected 41 lines, got %s lines\n\n", count($content)); $line = 37; $lines = []; for ($i = max($line - 3, 1), $max = min($line + 3, count($content)); $i <= $max; ++$i) { $lines[] = '<li'.($i == $line ? ' class="selected"' : '').'>'.$content[$i - 1].'</li>'; } echo '<ol start="'.max($line - 3, 1).'">'.implode("\n", $lines).'</ol>';
Output for git.master, git.master_jit, rfc.property-hooks
Expected 41 lines, got 41 lines <ol start="34"><li> </span><span style="color: #0000BB">parent</span><span style="color: #007700">::</span><span style="color: #0000BB">initialize</span><span style="color: #007700">(</span><span style="color: #0000BB">$context</span><span style="color: #007700">, </span><span style="color: #0000BB">$moduleName</span><span style="color: #007700">, </span><span style="color: #0000BB">$actionName</span><span style="color: #007700">);</li> <li></li> <li> </span><span style="color: #FF8000">// include security configuration</li> <li class="selected"> </span><span style="color: #007700">if (</span><span style="color: #0000BB">$file </span><span style="color: #007700">= </span><span style="color: #0000BB">$context</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getConfigCache</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">checkConfig</span><span style="color: #007700">(</span><span style="color: #DD0000">'modules/'</span><span style="color: #007700">.</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getModuleName</span><span style="color: #007700">().</span><span style="color: #DD0000">'/config/security.yml'</span><span style="color: #007700">, </span><span style="color: #0000BB">true</span><span style="color: #007700">)) {</li> <li> require </span><span style="color: #0000BB">$file</span><span style="color: #007700">;</li> <li> }</li> <li> }</li></ol>

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:
37.71 ms | 411 KiB | 5 Q