3v4l.org

run code in 300+ PHP versions simultaneously
<?php $target_dir = "in/"; $target_filename = 'asurite_hw1.m'; // Splits the input file name and its extension. $base_name = pathinfo($target_filename, PATHINFO_FILENAME); $extension = pathinfo($target_filename, PATHINFO_EXTENSION); echo 'base_name: ' . $base_name . "\n"; echo 'extension: ' . $extension . "\n"; $previous_files = glob($target_dir . $base_name . '*'); $previous_files = array('asurite_hw1_1.m'); $id = 1; foreach ($previous_files as $f) { $r = preg_match('/.+_(\d+)\.m/', $f, $matches); if (count($matches) > 1 && $id <= $matches[1]) { $id = $id + 1; } } print_r($id); // $pattern = '/^asurite ?>
Output for git.master, git.master_jit, rfc.property-hooks
base_name: asurite_hw1 extension: m 2

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:
40.39 ms | 401 KiB | 8 Q