3v4l.org

run code in 300+ PHP versions simultaneously
<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 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
<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(): open_basedir restriction in effect. File(Auto.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/KqMJM on line 26 Warning: include(Auto.php): Failed to open stream: Operation not permitted 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 8.0.13
<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 7.3.32 - 7.3.33, 7.4.33
<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 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.32
<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(): open_basedir restriction in effect. File(Auto.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/KqMJM on line 26 Warning: include(Auto.php): failed to open stream: Operation not permitted 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.5.0 - 5.5.38, 5.6.0 - 5.6.40
<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(): open_basedir restriction in effect. File(Auto.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/KqMJM on line 26 Warning: include(Auto.php): failed to open stream: Operation not permitted 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.

preferences:
237.54 ms | 403 KiB | 334 Q