3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php /** * In Datenbank-Tabelle fuer Login-Formular vom letzten Mal ein Feld "letzter_Login" einfuegen vom Typ "Datetime". * * Die Sessions dienen dazu, Benutzer automatisch nach einer bestimmten Zeit Inaktivitaet auszuloggen, oder auch * einfach zu erfassen, wann der Benutzer das letzte Mal eingeloggt war. * * Sobald der Benutzer eingeloggt ist, fuegen wir folgenden Code ein: * * Session Start * Direkt am Anfang der Website */ session_start(); /** * globales SESSION-Array */ $_SESSION["registrieren.php"] = 1; /** * Eintrag des Users in der Session speichern */ $_SESSION["user"] = mysqli_fetch_array($ergebnis, MYSQL_ASSOC); /** * Testausgabe des Session-Array */ echo("<pre>".var_dump($_SESSION)."</pre>"); /** * Eintrag letzter Login updaten */ $sql2 = "UPDATE benutzer SET letzter_login=NOW() WHERE benutzername='".$_SESSION['user']['benutzername']."'"; mysqli_query($db_connection, $sql2); ?>
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Call to undefined function mysqli_fetch_array() in /in/grk4F:28 Stack trace: #0 {main} thrown in /in/grk4F on line 28
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined variable: ergebnis in /in/grk4F on line 28 Catchable fatal error: Argument 1 passed to mysqli_fetch_array() must be an instance of mysqli_result, null given in /in/grk4F on line 28
Process exited with code 255.
Output for 5.2.3 - 5.6.28
Fatal error: Call to undefined function mysqli_fetch_array() in /in/grk4F on line 28
Process exited with code 255.
Output for 5.0.0 - 5.2.2
<br /> <b>Warning</b>: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cookie - headers already sent in <b>/in/grk4F</b> on line <b>13</b><br /> <br /> <b>Warning</b>: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /in/grk4F:13) in <b>/in/grk4F</b> on line <b>13</b><br /> <br /> <b>Fatal error</b>: Call to undefined function mysqli_fetch_array() in <b>/in/grk4F</b> on line <b>28</b><br />
Process exited with code 255.
Output for 4.4.5 - 4.4.9
<br /> <b>Warning</b>: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cookie - headers already sent in <b>/in/grk4F</b> on line <b>13</b><br /> <br /> <b>Warning</b>: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /in/grk4F:13) in <b>/in/grk4F</b> on line <b>13</b><br /> <br /> <b>Fatal error</b>: Call to undefined function: mysqli_fetch_array() in <b>/in/grk4F</b> on line <b>28</b><br />
Process exited with code 255.
Output for 4.4.3 - 4.4.4
<br /> <b>Warning</b>: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cookie - headers already sent in <b>/in/grk4F</b> on line <b>13</b><br /> <br /> <b>Warning</b>: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /in/grk4F:13) in <b>/in/grk4F</b> on line <b>13</b><br /> <br /> <b>Fatal error</b>: Call to undefined function: mysqli_fetch_array() in <b>/in/grk4F</b> on line <b>28</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.4.2
<br /> <b>Warning</b>: session_start(): Cannot send session cookie - headers already sent in <b>/in/grk4F</b> on line <b>13</b><br /> <br /> <b>Warning</b>: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/grk4F:13) in <b>/in/grk4F</b> on line <b>13</b><br /> <br /> <b>Fatal error</b>: Call to undefined function: mysqli_fetch_array() in <b>/in/grk4F</b> on line <b>28</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<br /> <b>Warning</b>: session_start() [<a href='http://www.php.net/function.session-start'>function.session-start</a>]: Cannot send session cookie - headers already sent in <b>/in/grk4F</b> on line <b>13</b><br /> <br /> <b>Warning</b>: session_start() [<a href='http://www.php.net/function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /in/grk4F:13) in <b>/in/grk4F</b> on line <b>13</b><br /> <br /> <b>Fatal error</b>: Call to undefined function: mysqli_fetch_array() in <b>/in/grk4F</b> on line <b>28</b><br />