3v4l.org

run code in 500+ PHP versions simultaneously
<?php use function PHPStan\dumpType; final class SinglePickSKU { public function renderEditControls(string $id): string { preg_match('/(\d+)$/', $id, $result); $counter = ''; if (is_numeric($result[1])) { if ($result[1] < 10) { $counter = '0' . $result[1] . '. '; } else { $counter = $result[1] . '. '; } } var_dump($counter); $html = ''; $html .= doFoo($counter . 'abc'); return $html; } } function doFoo(string $s):string { return $s; } $s = new SinglePickSKU(); $s->renderEditControls('');
Output for git.master, git.master_jit
Warning: Undefined array key 1 in /in/fbc2F on line 12 string(0) ""

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.02 ms | 789 KiB | 4 Q