3v4l.org

run code in 300+ PHP versions simultaneously
<?php session_start(); $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $city = "Amersfoort"; /* create a prepared statement */ if ($stmt = $mysqli->prepare("SELECT * FROM `users` WHERE username=? AND password=?")) { /* bind parameters for markers */ $stmt->bind_param("ss", $username,$password); /* execute query */ $stmt->execute(); /* bind result variables */ $stmt->bind_result($result); /* fetch value */ $stmt->fetch(); if( count($result) > 0 ){ $_SESSION['authentificated'] = true; $_SESSION['username'] = $username; } /* close statement */ $stmt->close(); } /* close connection */ $mysqli->close(); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Class "mysqli" not found in /in/YOBGX:3 Stack trace: #0 {main} thrown in /in/YOBGX 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:
14.98 ms | 405 KiB | 5 Q