3v4l.org

run code in 300+ PHP versions simultaneously
<?php $content = <<<HTML <table> <thead> <tr> <th>1</th> <th>2</th> </tr> </thead> <tbody> <tr> <td> <table> <thead> <tr> <th>A</th> <th>B</th> </tr> </thead> <tbody> <tr> <td>C</td> <td>D</td> </tr> </tbody> </table> </td> <td>4</td> </tr> </tbody> </table> HTML; var_dump( preg_replace_callback('~<table.*?</table>~is', function ($match) { return '<div>' . $match[0] . '</div>'; }, $content) );
Output for git.master_jit, git.master, rfc.property-hooks
string(812) " <div><table> <thead> <tr> <th>1</th> <th>2</th> </tr> </thead> <tbody> <tr> <td> <table> <thead> <tr> <th>A</th> <th>B</th> </tr> </thead> <tbody> <tr> <td>C</td> <td>D</td> </tr> </tbody> </table></div> </td> <td>4</td> </tr> </tbody> </table>"

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:
53.72 ms | 407 KiB | 5 Q