3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<html> <head> <title>TODO supply a title</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <table style="width: 50%"> <tr> <td><a href="?order=name">Nazov</a></td> <td><a href="?order=model">Model</a></td> <td><a href="?">Naspat</a></td> </tr> <?php /** * Created by PhpStorm. * User: maruna2 * Date: 5.11.2015 * Time: 18:31 */ include("Auto.php"); function compare($a,$b) { if(isset($_GET["order"])) { if($_GET["order"]=="name") return strcmp($a->getNazov(),$b->getNazov()); if($_GET["order"]=="model") return strcmp($a->getModel(),$b->getModel()); } return 0; } $pole; $pole[] = new Auto("Ford","Escort"); $pole[] = new Auto("Ford","Focus"); $pole[] = new Auto("Skoda","Fabia"); $pole[] = new Auto("Volkswagen","Golf"); $pole[] = new Auto("Chevrolet","Corvette"); usort($pole, "compare"); ?> <?php foreach($pole as $auto) {?> <tr> <td><?php echo $auto->getNazov()?></td> <td><?php echo $auto->getModel()?></td> </tr> <?php } ?> </table> </body> </html>
Output for 7.0.0 - 7.2.0
<html> <head> <title>TODO supply a title</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <table style="width: 50%"> <tr> <td><a href="?order=name">Nazov</a></td> <td><a href="?order=model">Model</a></td> <td><a href="?">Naspat</a></td> </tr> Warning: include(Auto.php): failed to open stream: No such file or directory in /in/KqMJM on line 26 Warning: include(): Failed opening 'Auto.php' for inclusion (include_path='.:') in /in/KqMJM on line 26 Fatal error: Uncaught Error: Class 'Auto' not found in /in/KqMJM:42 Stack trace: #0 {main} thrown in /in/KqMJM on line 42
Process exited with code 255.
Output for 5.3.19 - 5.6.28
<html> <head> <title>TODO supply a title</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <table style="width: 50%"> <tr> <td><a href="?order=name">Nazov</a></td> <td><a href="?order=model">Model</a></td> <td><a href="?">Naspat</a></td> </tr> Warning: include(Auto.php): failed to open stream: No such file or directory in /in/KqMJM on line 26 Warning: include(): Failed opening 'Auto.php' for inclusion (include_path='.:') in /in/KqMJM on line 26 Fatal error: Class 'Auto' not found in /in/KqMJM on line 42
Process exited with code 255.