3v4l.org

run code in 300+ PHP versions simultaneously
<?php // include('database.php'); // require('fpdf.php'); class FPDF {} $process = new Process(); class PDF extends FPDF { function Header() { // Logo $this->Image('logo.png',10,6,30); // Arial bold 15 $this->SetFont('Arial','B',15); // Move to the right $this->Cell(80); // Title $this->Cell(30,10,'Title',1,0,'C'); // Line break $this->Ln(20); } function Footer() { // Position at 1.5 cm from bottom $this->SetY(-15); // Arial italic 8 $this->SetFont('Arial','I',8); // Page number $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C'); } } class Process { private $dbconn; private $pdf; private $resultarr = array(); private $identarr = array(); function __construct() { $this->dbconn = new Database(); $this->pdf = new PDF(); $this->init(0); } private function init($i) { switch($i) { case 0: $query = "SELECT ident FROM vm_result WHERE date > NOW() - INTERVAL 7 DAY GROUP BY ident"; break; case 1: break; } $this->load_entries($query); } private function load_entries($query) { $result = $this->dbconn->query($query); while($row = $result->fetch_assoc()) { array_push($this->identarr, $row['ident']); } // loop per customer foreach($this->identarr as $ident) { $this->resultarr = array(); $query = "SELECT name, count, date FROM vm_result WHERE ident = '$ident' ORDER BY date ASC"; $result = $this->dbconn->query($query); while($row = $result->fetch_assoc()) { $str = $row['name'] . ':' . $row['count'] . ':' . $row['date']; array_push($this->resultarr, $str); } // summarize $this->summarize(); } } private function summarize() { foreach($this->resultarr as $entry) { $tmp = explode(":", $entry); $name = $tmp[0]; $count = $tmp[1]; $day = $tmp[2]; } } } ?>
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Class "Database" not found in /in/aijSt:47 Stack trace: #0 /in/aijSt(7): Process->__construct() #1 {main} thrown in /in/aijSt on line 47
Process exited with code 255.

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:
47.39 ms | 401 KiB | 8 Q