3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = 1; $videosPerPage = 20; $search = "Hello World"; $searchArray = explode(' ', $search); $likes = rtrim(str_repeat('title LIKE ? OR ', count($searchArray)), ' OR '); $parameters = array_map(function($value) { return '%' . $value . '%'; }, $searchArray); $query = 'SELECT id, title, videoTime FROM videos WHERE categories LIKE "skateboard" AND ' . $likes . ' ORDER BY id DESC LIMIT '. $start . ',' . $videosPerPage; //$stmt = $pdo->prepare($query); //$stmt->execute($parameters); var_dump($query); echo '------------' . \PHP_EOL; var_dump($parameters);
Output for git.master, git.master_jit, rfc.property-hooks
string(139) "SELECT id, title, videoTime FROM videos WHERE categories LIKE "skateboard" AND title LIKE ? OR title LIKE ? ORDER BY id DESC LIMIT 1,20" ------------ array(2) { [0]=> string(7) "%Hello%" [1]=> string(7) "%World%" }

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