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 git.master, git.master_jit, rfc.property-hooks
<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.

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:
51.34 ms | 402 KiB | 8 Q