3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class RequestSQL { public $ar=array(); /////////////////////////////////return Other Name Page (Il faut inserer var $url) public function link_pages($pdo,$url){ $dbb=$pdo->prepare('SELECT link FROM other_np WHERE link=:vurl'); $dbb->execute(array('vurl' => $url)); $res=$dbb->fetch(); if($res){return $ar="other";} else{ $dbb=$pdo->prepare('SELECT link FROM art_np WHERE link=:vurl'); $dbb->execute(array('vurl' => $url)); $res=$dbb->fetch(); if($res){return $ar="Article";} else{ return $ar="Error"; } } } public function trends_selectAll($pdo){ $i=0; $dbb=$pdo->query('SELECT * FROM trends LIMIT 0,5'); while($res=$dbb->fetch()) { $ar[]=$res; } return $ar; } public function carrousel_selectNote($pdo){ $i=0; $dbb=$pdo->query('SELECT * FROM art_all left join art_info on art_all.artID=art_info.infoID WHERE info="top"'); while($res=$dbb->fetch()) { $ar[]=$res; } return $ar; } public function new_popular_selectLIMIT($pdo,$pagination){ $i=0; if($pagination>=0){$start=$pagination*5; $end=$start+5;}else{$start=0; $end=5;} $sql='SELECT * FROM art_all LIMIT '.$start.','.$end; $dbb=$pdo->query($sql); while($res=$dbb->fetch()) { $ar[]=$res; } return $ar; } public function category_around_the_word($pdo,$pagination){ $i=0; if($pagination>=0){$start=$pagination*5; $end=$start+5;} $sql='SELECT * FROM art_all LIMIT '.$start.','.$end; $dbb=$pdo->query($sql); while($res=$dbb->fetch()) { $ar[]=$res; } return $ar; } }
Output for 5.6.30, hhvm-3.18.5 - 3.22.0, 7.0.30 - 7.3.0alpha1