3v4l.org

run code in 500+ PHP versions simultaneously
<?php header("Content-type: application/json"); require_once "config/database.php"; $db = new database(); $mysqli = $db->connect(); $balai = mysqli_real_escape_string($mysqli, $_GET['balai']); if ($balai == 'bl-1') { $sql = "SELECT plan, actual FROM scurve1 ORDER BY id ASC"; } else if ($balai == 'bl-2') { $sql = "SELECT plan, actual FROM scurve2 ORDER BY id ASC"; } else if ($balai == 'bl-3') { $sql = "SELECT plan, actual FROM scurve3 ORDER BY id ASC"; } $hasil = array(); $result = $mysqli->query($sql); while ($data = $result->fetch_assoc()) { $hasil['data'][]=['name'=>'Plan', 'data' => $data['plan']]; $hasil['data'][]=['name'=>'Actual', 'data' => $data['actual']]; } print json_encode($hasil, JSON_NUMERIC_CHECK); $mysqli->close();
Output for git.master, git.master_jit, rfc.property-hooks
Warning: require_once(): open_basedir restriction in effect. File(config/database.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/lhqMFm on line 3 Warning: require_once(config/database.php): Failed to open stream: Operation not permitted in /in/lhqMFm on line 3 Fatal error: Uncaught Error: Failed opening required 'config/database.php' (include_path='.:') in /in/lhqMFm:3 Stack trace: #0 {main} thrown in /in/lhqMFm on line 3
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:
23.77 ms | 1351 KiB | 4 Q