3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Display the platform scores added together $database = new PDO('mysql:host=db452664775.db.1and1.com;dbname=db452664775;charset=utf8', 'dbo452664775', '$h13ld@l13n'); //read the android scores from the MYSQL database $query = $database->prepare("SELECT * FROM `MinionTotalsAndroid` WHERE 1"); $query->execute(); $android = $query->fetchAll();// as $android; echo ($android[scoreTotal]); //read the iphone scores from the MYSQL database $query2 = $database->prepare("SELECT * FROM `MinionTotalsiPhone` WHERE 1"); $query2->execute(); $iOS = $query2->fetchAll();// as $iOS;; //calculate the Accuracy to 2 decimal places //number_format( (($android['rktsHit'] + $iOS['rktsHit'] ) / ( $android['rktsFired'] + $iOS['rktsFired'])) * 100, 2); echo ($android['scoreTotal'] + $iOS['scoreTotal']) . '-' .($android['junkTotal'] + $iOS['junkTotal']) . '-' .($android['shpKlldByAstrd']+ $iOS['shpKlldByAstrd']) . '-' .($android['shpKlldBySatlt']+ $iOS['shpKlldBySatlt']) . '-' .($android['shpKlldByWrm'] + $iOS['shpKlldByWrm']) . '-' .($android['shpKlldByPrt'] + $iOS['shpKlldByPrt']) . '-' .($android['deathsTotal'] + $iOS['deathsTotal']) . '-' .($android['minKlldByAst'] + $iOS['minKlldByAst']) . '-' .($android['minKlldBySatlt']+ $iOS['minKlldBySatlt']) . '-' .($android['minKlldByWrm'] + $iOS['minKlldByWrm']) . '-' .($android['minKlldByPrt'] + $iOS['minKlldByPrt']) . '-' .($android['deathsTotal'] + $iOS['deathsTotal']) . '-' .($android['shldUsd'] + $iOS['shldUsd']) . '-' .($android['shldDstryd'] + $iOS['shldDstryd']) . '-' .($android['hmngUsd'] + $iOS['hmngUsd']) . '-' .($android['pwrUsd'] + $iOS['pwrUsd']) . '-' .($android['rktsFired'] + $iOS['rktsFired']) . '-' .($android['rktsHit'] + $iOS['rktsHit']) . '-' .($android['rktsMssd'] + $iOS['rktsMssd']) . '-' .(number_format( (($android['rktsHit'] + $iOS['rktsHit'] ) / ( $android['rktsFired'] + $iOS['rktsFired'])) * 100, 2)) . '-' .($android['astKlldByShp'] + $iOS['astKlldByShp']) . '-' .($android['astrdKlldByMin']+ $iOS['astrdKlldByMin']) . '-' .($android['astrdEscp'] + $iOS['astrdEscp']) . '-' .($android['astrdKlls'] + $iOS['astrdKlls']) . '-' .($android['satltKlldByShp']+ $iOS['satltKlldByShp']) . '-' .($android['satltKlldByMin']+ $iOS['satltKlldByMin']) . '-' .($android['satltEscp'] + $iOS['satltEscp']) . '-' .($android['satltKlls'] + $iOS['satltKlls']) . '-' .($android['wrmKlldByShp'] + $iOS['wrmKlldByShp']) . '-' .($android['wrmKlldByMin'] + $iOS['wrmKlldByMin']) . '-' .($android['wrmKlls'] + $iOS['wrmKlls']) . '-' .($android['prtKlldByShp'] + $iOS['prtKlldByShp']) . '-' .($android['prtKlldByMin'] + $iOS['prtKlldByMin']) . '-' .($android['prtKlls'] + $iOS['prtKlls']);
Output for 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Fatal error: Uncaught PDOException: could not find driver in /in/gqKld:3 Stack trace: #0 /in/gqKld(3): PDO->__construct('mysql:host=db45...', 'dbo452664775', Object(SensitiveParameterValue)) #1 {main} thrown in /in/gqKld on line 3
Process exited with code 255.
Output for 7.0.0 - 7.0.31, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27
Fatal error: Uncaught PDOException: could not find driver in /in/gqKld:3 Stack trace: #0 /in/gqKld(3): PDO->__construct('mysql:host=db45...', 'dbo452664775', '$h13ld@l13n') #1 {main} thrown in /in/gqKld on line 3
Process exited with code 255.
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.38
Fatal error: Uncaught exception 'PDOException' with message 'could not find driver' in /in/gqKld:3 Stack trace: #0 /in/gqKld(3): PDO->__construct('mysql:host=db45...', 'dbo452664775', '$h13ld@l13n') #1 {main} thrown in /in/gqKld on line 3
Process exited with code 255.

preferences:
251.27 ms | 402 KiB | 312 Q