3v4l.org

run code in 300+ PHP versions simultaneously
<?php #include_once("con.php"); #$db = new Da(); $con = false; $String = "{{ONE}} {{TWO}} {{THREE}} {{FOUR}} {{FIVE}} {{SIX}}"; $new_string = preg_replace_callback('~{{[^}{]+}}~', function($m) use ($con) { $Query = "SELECT link FROM student WHERE linkVal = '".$m[0]."'"; // uncomment var_dump($Query); #$Result = $con->query($Query); #if($row = $Result->fetch(PDO::FETCH_ASSOC)) { # return $row["link"]; #} }, $String); var_dump($new_string); ?>
Output for git.master, git.master_jit, rfc.property-hooks
string(50) "SELECT link FROM student WHERE linkVal = '{{ONE}}'" string(50) "SELECT link FROM student WHERE linkVal = '{{TWO}}'" string(52) "SELECT link FROM student WHERE linkVal = '{{THREE}}'" string(51) "SELECT link FROM student WHERE linkVal = '{{FOUR}}'" string(51) "SELECT link FROM student WHERE linkVal = '{{FIVE}}'" string(50) "SELECT link FROM student WHERE linkVal = '{{SIX}}'" string(5) " "

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:
156.55 ms | 406 KiB | 5 Q