3v4l.org

run code in 300+ PHP versions simultaneously
<?php function replace($originalcontent){ $replacethis = '(<a href=\"([0-9]{2})\\.htm\">)'; $linkArr = []; $lessonNo = preg_match_all($replacethis, $originalcontent, $linkArr); for($x = 0; $x < count($linkArr[1]); $x++) { $replacethis = '<a href="'.$linkArr[1][$x].'.htm">'; $replacewith = '<a style="cursor:pointer;" onclick="gotoScrollExercise('. $linkArr[1][$x] .'); return false;">'; $originalcontent = str_replace($replacethis, $replacewith, $originalcontent); } return $originalcontent; } $originalcontent = '<a href="04.htm">'; $originalcontent = replace($originalcontent); var_dump($originalcontent);
Output for git.master, git.master_jit, rfc.property-hooks
string(75) "<a style="cursor:pointer;" onclick="gotoScrollExercise(04); return false;">"

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:
30.49 ms | 405 KiB | 5 Q