3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $clientNumber = '100'; $supportNumber = '22123322'; $countryCode = 'GB'; $db = new mysqli('dbmaster', 'user', 'pass', 'dbname'); $existingResult = $db->query(sprintf( "SELECT `id` FROM `calls_queue` WHERE `client_number` = '%s' AND `support_number` = '%s' AND `status` = 0", $clientNumber, $supportNumber )); if ($existingResult && $existingResult->num_rows) { $call = $existingResult->fetch_assoc(); $result = $db->query(sprintf("UPDATE `calls_queue` SET `calls` = `calls` + 1 WHERE `id` = %d", $call['id'])); } else { $result = $db->query(sprintf( "INSERT INTO `calls_queue` (`client_number`, `support_number`, `country_code`, `calls`) VALUES ('%s', '%s', '%s', 1)", $clientNumber, $supportNumber, $countryCode )); }
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Class 'mysqli' not found in /in/oMUS4:7 Stack trace: #0 {main} thrown in /in/oMUS4 on line 7
Process exited with code 255.
Output for 5.0.0 - 5.6.28
Fatal error: Class 'mysqli' not found in /in/oMUS4 on line 7
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: mysqli in /in/oMUS4 on line 7
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: mysqli in /in/oMUS4 on line 7