3v4l.org

run code in 300+ PHP versions simultaneously
<?php require_once('config.php'); $table = 'ILRL'; $requestedWO = $_GET['wo']; // Grab last 20 workorders $query = $bd->prepare("SELECT DISTINCT workorder FROM $table Order By date_time DESC LIMIT 20"); try { if(!$query->execute()) die(print_r($bd->errorInfo())); $woList = $query->fetchAll(PDO::FETCH_OBJ); } catch (Exception $e) { echo $e->getMessage(); } // wo results if( empty($requestedWO) ) $requestedWO = $woList[0]->workorder; $tableheader = false; $query = $bd->prepare("SELECT * FROM $table WHERE workorder=$requestedWO ORDER BY date_time DESC LIMIT 1000"); try { if(!$query->execute()) die(print_r($bd->errorInfo())); echo "<table class='striped responsive-table'>"; while($row = $query->fetch(PDO::FETCH_ASSOC)) { if($tableheader == false) { echo '<thead><tr>'; foreach($row as $key=>$value) { echo "<th>{$key}</th>"; } echo '</tr></thead><tbody>'; $tableheader = true; } echo "<tr>"; foreach($row as $value) { echo "<td>{$value}</td>"; } echo "</tr>"; } echo "</tbody></table>"; } catch (Exception $e) { echo $e->getMessage(); } ?> <script type="text/javascript"> var woListFromSQL = <?php print(json_encode($woList)); ?>; </script>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: require_once(): open_basedir restriction in effect. File(config.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/p4YWR on line 2 Warning: require_once(config.php): Failed to open stream: Operation not permitted in /in/p4YWR on line 2 Fatal error: Uncaught Error: Failed opening required 'config.php' (include_path='.:') in /in/p4YWR:2 Stack trace: #0 {main} thrown in /in/p4YWR on line 2
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:
141.1 ms | 401 KiB | 8 Q