online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
<?php class Database { private $host = 'localhost'; private $db_user = 'root'; private $db_pass = ''; private $db_name = 'social'; function connect() { $connection = mysqli_connect($this->host, $this->db_user, $this->db_pass,$this->db_name); return $connection; } function read($query) { //$conn = $this->connect(); $result = true; //mysqli_query($conn, $query); if (!$result) return false; $result_arr = [ // dla demonstracji 0 => [ 'id' => 11, 'userid' => 0, 'first_name' => 'Piotr', 'last_name' => 'Żbikowsi', 'gender' => 'gender', 'email' => 'email', 'password' => 'password', 'url_address' => 'url_address', 'date' => '2022-12-02 21:46:48' ] ]; //$row = mysqli_fetch_assoc($result); //return array_reduce($row, function ($l, $r) { return $l + $r; }, []); return array_reduce($result_arr, function ($l, $r) { return $l + $r; }, []); } } //$db= new Database(); $result2 = Database::read(''); //$db->read("SELECT * FROM users where id=11"); echo "<pre>" . PHP_EOL; print_r($result2); echo "</pre>" . PHP_EOL; echo $result2['first_name'];

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue