3v4l.org

run code in 300+ PHP versions simultaneously
<?php // controllers/BookController.php class BooksController { function index() { $books = Book::all(); } function show() { $id = 1; $books = Book::find(1); } } class MVCFramework { var $url = ''; function __construct($url) { $this->url = $url; //HTTP_REQUEST URL $this->run(); } function run() { if ($route = Routes::getRoute($this->url)) { list($controller, $action) = $route; print_r($$controller); //$controllerObj = new $$controller; //$controllerObj->$$action(); //template } else { print_r('404'); } } } class Routes { static $routes = array(); static function add($route, $controller, $action) { self::$routes[$route] = array($controller.'Controller', $action); } static function getRoutes() { return self::$routes; } static function getRoute($url) { return self::$routes[$url]; } } abstract class Model { // connect to DB and etc. } // models/Book.php class Book { static function all() { $books = array('Book', 'Book', 'Book'); return $books; } static function find() { $book = 'Book'; return $book; } } Routes::add('/books', 'Books', 'index'); Routes::add('/books/:id', 'Books', 'show'); $url = '/books'; new MVCFramework($url);

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.60.0040.01816.75
8.3.50.0140.00821.82
8.3.40.0140.00718.64
8.3.30.0070.01019.23
8.3.20.0060.00320.34
8.3.10.0090.00023.59
8.3.00.0040.00419.16
8.2.180.0100.00716.75
8.2.170.0070.00722.96
8.2.160.0130.00020.35
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0070.00026.16
8.2.120.0080.00020.76
8.2.110.0040.00722.11
8.2.100.0070.00418.03
8.2.90.0000.00819.26
8.2.80.0000.00817.97
8.2.70.0100.00317.63
8.2.60.0080.00018.05
8.2.50.0070.00718.07
8.2.40.0050.00319.73
8.2.30.0000.00818.22
8.2.20.0040.00417.79
8.2.10.0000.00818.20
8.2.00.0000.00817.79
8.1.280.0070.00725.92
8.1.270.0080.00023.88
8.1.260.0080.00026.35
8.1.250.0000.00828.09
8.1.240.0060.00322.07
8.1.230.0080.00319.04
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0030.00617.47
8.1.190.0050.00317.25
8.1.180.0040.00418.10
8.1.170.0050.00318.71
8.1.160.0000.00722.04
8.1.150.0040.00418.58
8.1.140.0040.00417.52
8.1.130.0040.00417.84
8.1.120.0050.00217.39
8.1.110.0070.00417.46
8.1.100.0040.00417.46
8.1.90.0000.00717.37
8.1.80.0040.00417.38
8.1.70.0070.00017.37
8.1.60.0030.00517.64
8.1.50.0040.00417.52
8.1.40.0040.00417.52
8.1.30.0040.00417.64
8.1.20.0030.00617.57
8.1.10.0000.00717.49
8.1.00.0000.00717.55
8.0.300.0000.00718.77
8.0.290.0040.00417.16
8.0.280.0000.00718.44
8.0.270.0040.00417.28
8.0.260.0000.00717.21
8.0.250.0000.00717.11
8.0.240.0070.00017.02
8.0.230.0000.00616.89
8.0.220.0030.00517.02
8.0.210.0070.00016.96
8.0.200.0030.00317.04
8.0.190.0040.00417.04
8.0.180.0000.01016.89
8.0.170.0000.00717.05
8.0.160.0000.00717.05
8.0.150.0040.00416.98
8.0.140.0030.00517.00
8.0.130.0030.00313.42
8.0.120.0000.00816.95
8.0.110.0000.00816.91
8.0.100.0000.00716.98
8.0.90.0000.00717.05
8.0.80.0120.00617.02
8.0.70.0020.00516.86
8.0.60.0030.00616.92
8.0.50.0000.00817.05
8.0.30.0100.01117.03
8.0.20.0100.00917.40
8.0.10.0040.00417.11
8.0.00.0030.01416.72
7.4.330.0000.00515.00
7.4.320.0030.00316.68
7.4.300.0060.00316.54
7.4.290.0000.00716.52
7.4.280.0040.00416.52
7.4.270.0030.00316.64
7.4.260.0050.00216.45
7.4.250.0070.00016.57
7.4.240.0050.00216.56
7.4.230.0040.00416.72
7.4.220.0070.01116.64
7.4.210.0170.00316.52
7.4.200.0070.00016.44
7.4.190.0030.00316.49
7.4.160.0060.00916.57
7.4.150.0080.01117.40
7.4.140.0140.00817.86
7.4.130.0090.00816.60
7.4.120.0120.00816.52
7.4.110.0150.00416.83
7.4.100.0140.00616.59
7.4.90.0150.00316.43
7.4.80.0070.01019.39
7.4.70.0070.01016.45
7.4.60.0140.00316.66
7.4.50.0050.00016.76
7.4.40.0030.01716.48
7.4.30.0130.00316.68
7.4.00.0030.01314.87
7.3.330.0000.00613.32
7.3.320.0030.00313.22
7.3.310.0040.00416.41
7.3.300.0030.00316.38
7.3.290.0120.00316.38
7.3.280.0090.00816.50
7.3.270.0140.00317.40
7.3.260.0130.00616.53
7.3.250.0120.00816.67
7.3.240.0140.00416.63
7.3.230.0100.00716.42
7.3.210.0030.01316.54
7.3.200.0190.00319.39
7.3.190.0100.01316.60
7.3.180.0110.00716.42
7.3.170.0070.01016.59
7.3.160.0100.00616.68
7.3.120.0070.01114.76
7.2.330.0040.01216.61
7.2.320.0070.01416.71
7.2.310.0080.00816.71
7.2.300.0100.00716.70
7.2.290.0060.01216.60
7.2.00.0030.00919.36
7.1.100.0060.00318.25
7.1.70.0100.00717.25
7.1.60.0070.01819.70
7.1.50.0210.00934.81
7.1.00.0030.07322.28
7.0.200.0110.00316.76
7.0.140.0000.07721.98
7.0.100.0170.04720.14
7.0.90.0170.08320.11
7.0.80.0170.06719.94
7.0.70.0170.06019.89
7.0.60.0100.08019.95
7.0.50.0070.08320.23
7.0.40.0070.07720.03
7.0.30.0100.08720.03
7.0.20.0070.08020.13
7.0.10.0100.07720.02
7.0.00.0100.07720.02
5.6.280.0030.07320.95
5.6.250.0230.07020.61
5.6.240.0170.05020.64
5.6.230.0030.04320.63
5.6.220.0170.07020.46
5.6.210.0070.07020.43
5.6.200.0100.08321.09
5.6.190.0070.07021.00
5.6.180.0070.06721.14
5.6.170.0030.07021.00
5.6.160.0030.05321.11
5.6.150.0100.08720.99
5.6.140.0130.07721.01
5.6.130.0100.07321.05
5.6.120.0130.07320.90
5.6.110.0100.08321.04
5.6.100.0100.07020.92
5.6.90.0130.07721.09
5.6.80.0000.08020.32
5.6.70.0070.06020.45
5.6.60.0030.07720.27
5.6.50.0030.07320.37
5.6.40.0130.07020.29
5.6.30.0030.08020.30
5.6.20.0030.05320.39
5.6.10.0030.08020.38
5.6.00.0030.05020.34
5.5.380.0130.07720.37
5.5.370.0030.07320.34
5.5.360.0070.08020.34
5.5.350.0030.08020.43
5.5.340.0200.06720.90
5.5.330.0000.08020.80
5.5.320.0000.08320.82
5.5.310.0130.07320.86
5.5.300.0230.06720.76
5.5.290.0130.06320.71
5.5.280.0100.08320.75
5.5.270.0100.07720.82
5.5.260.0130.07320.82
5.5.250.0100.07720.55
5.5.240.0100.06020.28
5.5.230.0000.08320.26
5.5.220.0070.04720.12
5.5.210.0030.08320.04
5.5.200.0130.04720.16
5.5.190.0130.05320.20
5.5.180.0030.08320.23
5.5.160.0070.07720.21
5.5.150.0230.06020.11
5.5.140.0100.06320.20
5.5.130.0200.06720.21
5.5.120.0070.08020.23
5.5.110.0100.08320.15
5.5.100.0070.06020.09
5.5.90.0100.07320.14
5.5.80.0170.06320.04
5.5.70.0100.04320.12
5.5.60.0100.07720.11
5.5.50.0130.07320.12
5.5.40.0070.07320.01
5.5.30.0070.05319.90
5.5.20.0070.07019.90
5.5.10.0100.07719.99
5.5.00.0100.07720.05
5.4.450.0100.05719.42
5.4.440.0100.07719.32
5.4.430.0070.04719.45
5.4.420.0070.08019.20
5.4.410.0030.08019.33
5.4.400.0000.08719.17
5.4.390.0100.07318.90
5.4.380.0130.07319.03
5.4.370.0100.07719.05
5.4.360.0000.07319.10
5.4.350.0000.08318.86
5.4.340.0000.08318.88
5.4.320.0100.07319.04
5.4.310.0000.08019.04
5.4.300.0170.06018.93
5.4.290.0100.04018.96
5.4.280.0030.07719.18
5.4.270.0100.07319.20
5.4.260.0100.07319.13
5.4.250.0000.08019.02
5.4.240.0100.07319.16
5.4.230.0170.06718.86
5.4.220.0030.06318.89
5.4.210.0070.07718.89
5.4.200.0100.07019.02
5.4.190.0000.08019.20
5.4.180.0070.07319.04
5.4.170.0030.08719.04
5.4.160.0070.07318.84
5.4.150.0000.08319.12
5.4.140.0030.07316.46
5.4.130.0070.05016.31
5.4.120.0030.08016.17
5.4.110.0130.05716.56
5.4.100.0130.04716.48
5.4.90.0100.05716.51
5.4.80.0130.07316.47
5.4.70.0000.07716.51
5.4.60.0100.06016.46
5.4.50.0100.06716.44
5.4.40.0070.04016.50
5.4.30.0030.08016.42
5.4.20.0170.06316.33
5.4.10.0100.04716.30
5.4.00.0200.05715.72
5.3.290.0070.08014.76
5.3.280.0070.07314.65
5.3.270.0070.07314.68
5.3.260.0130.07014.63
5.3.250.0030.07314.75
5.3.240.0100.07014.70
5.3.230.0030.08314.73
5.3.220.0030.05714.61
5.3.210.0100.07014.57
5.3.200.0100.07014.65
5.3.190.0130.06714.52
5.3.180.0030.05014.64
5.3.170.0000.07314.52
5.3.160.0070.07314.57
5.3.150.0030.07714.52
5.3.140.0100.07014.53
5.3.130.0100.07314.63
5.3.120.0000.08314.51
5.3.110.0100.05314.66
5.3.100.0100.06714.04
5.3.90.0170.05714.18
5.3.80.0130.06314.10
5.3.70.0100.06313.93
5.3.60.0100.04014.00
5.3.50.0070.05714.06
5.3.40.0030.08013.99
5.3.30.0070.07014.00
5.3.20.0030.07313.73
5.3.10.0000.07713.61
5.3.00.0100.06013.75
5.2.170.0030.06011.20
5.2.160.0000.06711.05
5.2.150.0130.05311.09
5.2.140.0100.03711.30
5.2.130.0000.06711.07
5.2.120.0030.06311.03
5.2.110.0100.05310.99
5.2.100.0070.05711.24
5.2.90.0070.06011.22
5.2.80.0030.06311.25
5.2.70.0030.06711.21
5.2.60.0030.04311.00
5.2.50.0030.06310.93
5.2.40.0070.05711.01
5.2.30.0030.06010.98
5.2.20.0000.06711.10
5.2.10.0030.06010.84
5.2.00.0130.05010.73
5.1.60.0070.05010.11
5.1.50.0070.04710.08
5.1.40.0130.05710.00
5.1.30.0030.05310.42
5.1.20.0000.03010.41
5.1.10.0070.05010.09
5.1.00.0000.0579.95
5.0.50.0030.0408.69
5.0.40.0100.0378.53
5.0.30.0000.0508.53
5.0.20.0030.0478.53
5.0.10.0030.0438.53
5.0.00.0030.0608.53
4.4.90.0000.0378.53
4.4.80.0030.0308.53
4.4.70.0070.0178.53
4.4.60.0070.0308.53
4.4.50.0000.0408.53
4.4.40.0000.0538.53
4.4.30.0030.0338.53
4.4.20.0070.0338.53
4.4.10.0000.0238.53
4.4.00.0070.0338.53
4.3.110.0030.0378.53
4.3.100.0030.0278.53
4.3.90.0030.0278.53
4.3.80.0000.0578.53
4.3.70.0030.0278.53
4.3.60.0000.0378.53
4.3.50.0000.0378.53
4.3.40.0000.0378.53
4.3.30.0000.0378.53
4.3.20.0070.0308.53
4.3.10.0000.0238.53
4.3.00.0030.0308.53

preferences:
46.7 ms | 401 KiB | 5 Q