3v4l.org

run code in 300+ PHP versions simultaneously
<?php 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; $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. } // controllers/BookController.php class BooksController { function index() { $books = Book::all(); } function show() { $id = 1; $books = Book::find(1); } } // 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.0100.00718.28
8.3.50.0080.00822.18
8.3.40.0000.01418.98
8.3.30.0090.00919.21
8.3.20.0080.00020.38
8.3.10.0050.00323.65
8.3.00.0080.00019.16
8.2.180.0130.01018.54
8.2.170.0070.00722.96
8.2.160.0100.00320.35
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0060.00326.16
8.2.120.0040.00420.92
8.2.110.0060.00322.20
8.2.100.0060.00617.91
8.2.90.0040.00419.11
8.2.80.0000.00817.97
8.2.70.0060.00317.50
8.2.60.0090.00017.93
8.2.50.0070.00318.07
8.2.40.0030.00618.28
8.2.30.0040.00418.36
8.2.20.0060.00317.78
8.2.10.0040.00418.16
8.2.00.0030.00517.70
8.1.280.0070.01025.92
8.1.270.0030.00623.96
8.1.260.0080.00026.35
8.1.250.0050.00228.09
8.1.240.0000.00823.84
8.1.230.0080.00419.15
8.1.220.0030.00517.74
8.1.210.0040.00418.77
8.1.200.0000.01017.36
8.1.190.0060.00317.36
8.1.180.0030.00618.10
8.1.170.0000.00818.71
8.1.160.0040.00421.95
8.1.150.0050.00318.72
8.1.140.0070.00017.48
8.1.130.0000.00817.89
8.1.120.0000.00717.50
8.1.110.0000.00917.49
8.1.100.0000.00817.46
8.1.90.0070.00017.41
8.1.80.0000.00717.55
8.1.70.0000.00717.38
8.1.60.0050.00317.50
8.1.50.0000.00717.53
8.1.40.0040.00417.51
8.1.30.0040.00417.68
8.1.20.0070.00017.60
8.1.10.0080.00017.62
8.1.00.0070.00017.56
8.0.300.0050.00218.77
8.0.290.0040.00417.05
8.0.280.0000.00718.45
8.0.270.0030.00317.28
8.0.260.0060.00017.39
8.0.250.0000.00717.00
8.0.240.0030.00516.98
8.0.230.0000.00817.00
8.0.220.0030.00316.96
8.0.210.0050.00316.83
8.0.200.0030.00316.90
8.0.190.0000.00816.84
8.0.180.0000.00716.94
8.0.170.0040.00416.85
8.0.160.0040.00416.99
8.0.150.0060.00316.83
8.0.140.0000.00716.84
8.0.130.0000.00513.32
8.0.120.0040.00416.89
8.0.110.0090.00016.96
8.0.100.0040.00416.80
8.0.90.0030.00516.79
8.0.80.0080.00816.87
8.0.70.0050.00316.88
8.0.60.0050.00316.86
8.0.50.0050.00316.97
8.0.30.0110.00816.98
8.0.20.0090.00917.40
8.0.10.0070.00017.04
8.0.00.0070.01016.84
7.4.330.0020.00215.00
7.4.320.0070.00016.44
7.4.300.0040.00416.48
7.4.290.0040.00416.50
7.4.280.0040.00416.48
7.4.270.0020.00516.55
7.4.260.0000.00716.48
7.4.250.0040.00416.60
7.4.240.0040.00416.61
7.4.230.0040.00416.59
7.4.220.0130.01316.67
7.4.210.0060.00916.60
7.4.200.0060.00316.38
7.4.190.0030.00316.65
7.4.160.0110.01116.54
7.4.150.0160.00317.40
7.4.140.0100.01017.86
7.4.130.0100.00716.50
7.4.120.0140.00516.49
7.4.110.0030.01316.68
7.4.100.0070.01116.70
7.4.90.0030.01316.41
7.4.80.0130.00719.39
7.4.70.0160.00616.74
7.4.60.0060.01016.30
7.4.50.0030.00516.55
7.4.40.0100.00916.68
7.4.30.0120.00516.55
7.4.00.0070.00715.18
7.3.330.0030.00313.42
7.3.320.0000.00513.35
7.3.310.0050.00316.29
7.3.300.0040.00216.27
7.3.290.0110.00416.41
7.3.280.0060.01316.37
7.3.270.0110.00717.40
7.3.260.0100.01416.69
7.3.250.0100.00916.38
7.3.240.0070.01016.57
7.3.230.0170.00016.67
7.3.210.0070.01016.48
7.3.200.0090.00919.39
7.3.190.0070.01016.68
7.3.180.0100.00616.53
7.3.170.0140.00316.62
7.3.160.0060.01116.44
7.3.120.0150.00314.85
7.2.330.0090.00916.76
7.2.320.0060.01416.53
7.2.310.0060.01016.50
7.2.300.0120.00416.66
7.2.290.0070.01716.65
7.1.200.0080.00415.90
7.1.70.0000.01017.12
7.1.60.0070.01119.70
7.1.50.0100.01616.75
7.1.00.0100.07022.30
7.0.200.0140.00016.73
7.0.140.0000.07721.97
7.0.60.0100.05320.05
7.0.50.0000.05717.89
7.0.40.0130.08020.40
7.0.30.0330.07720.08
7.0.20.0400.06320.32
7.0.10.0070.08020.23
7.0.00.0130.04320.11
5.6.280.0100.06721.09
5.6.210.0070.08720.66
5.6.200.0070.04318.27
5.6.190.0000.05020.41
5.6.180.0170.08320.41
5.6.170.0130.04720.50
5.6.160.0170.07320.39
5.6.150.0130.03718.24
5.6.140.0030.08318.15
5.6.130.0070.06718.18
5.6.120.0070.08721.01
5.6.110.0070.06721.11
5.6.100.0000.05320.98
5.6.90.0100.08021.05
5.6.80.0170.06020.53
5.5.350.0000.08320.37
5.5.340.0070.03717.96
5.5.330.0070.04320.27
5.5.320.0130.04720.46
5.5.310.0430.06720.34
5.5.300.0030.08717.96
5.5.290.0070.05017.94
5.5.280.0030.07320.66
5.5.270.0030.04320.89
5.5.260.0170.05320.91
5.5.250.0130.08020.61
5.5.240.0100.06720.29
5.4.450.0200.04319.39
5.4.440.0100.04319.16
5.4.430.0200.03319.54
5.4.420.0170.03719.19
5.4.410.0430.04719.07
5.4.400.0370.04349.64
5.4.390.0430.04346.74
5.4.380.0570.05718.59
5.4.370.0700.05318.70
5.4.360.0970.04718.74
5.4.350.0830.05718.71
5.4.340.0970.05018.73
5.4.320.0110.03212.53
5.4.310.0050.03912.52
5.4.300.0100.04812.53
5.4.290.0070.05812.51
5.4.280.0120.07112.42
5.4.270.0060.05512.41
5.4.260.0090.12512.41
5.4.250.0060.05812.41
5.4.240.0090.05912.42
5.4.230.0130.05312.41
5.4.220.0090.06012.41
5.4.210.0080.06612.40
5.4.200.0190.04612.40
5.4.190.0140.04812.40
5.4.180.0160.05112.40
5.4.170.0070.04912.42
5.4.160.0100.04712.41
5.4.150.0070.05512.40
5.4.140.0090.05112.09
5.4.130.0110.04712.07
5.4.120.0040.04612.04
5.4.110.0110.04712.03
5.4.100.0120.04312.03
5.4.90.0080.05812.03
5.4.80.0130.05612.03
5.4.70.0100.05512.03
5.4.60.0130.04612.03
5.4.50.0110.05112.03
5.4.40.0100.04812.02
5.4.30.0140.04412.02
5.4.20.0110.04812.01
5.4.10.0070.05312.01
5.4.00.0110.04911.50
5.3.290.0060.03812.80
5.3.280.0120.04612.71
5.3.270.0130.10112.73
5.3.260.0190.08212.72
5.3.250.0110.05312.72
5.3.240.0070.04612.72
5.3.230.0050.04312.71
5.3.220.0140.05012.68
5.3.210.0150.05612.68
5.3.200.0110.06512.68
5.3.190.0050.05712.67
5.3.180.0100.05412.67
5.3.170.0100.05512.67
5.3.160.0200.05212.68
5.3.150.0090.06012.67
5.3.140.0140.06612.66
5.3.130.0150.07312.66
5.3.120.0090.05712.66
5.3.110.0190.08812.66
5.3.100.0080.05212.13
5.3.90.0210.04212.12
5.3.80.0080.05212.12
5.3.70.0120.05012.11
5.3.60.0100.05012.09
5.3.50.0160.07712.05
5.3.40.0200.06912.05
5.3.30.0120.05712.00
5.3.20.0170.06311.80
5.3.10.0230.09411.75
5.3.00.0140.07611.74
5.2.170.0090.0559.24
5.2.160.0090.0489.25
5.2.150.0080.0409.25
5.2.140.0110.0399.23
5.2.130.0070.0429.20
5.2.120.0060.0399.20
5.2.110.0080.0399.21
5.2.100.0130.0319.20
5.2.90.0090.0399.20
5.2.80.0140.0439.20
5.2.70.0090.0449.20
5.2.60.0100.0419.15
5.2.50.0080.0439.12
5.2.40.0070.0349.09
5.2.30.0090.0379.08
5.2.20.0090.0399.06
5.2.10.0190.0338.96
5.2.00.0180.0458.84
5.1.60.0060.0298.12
5.1.50.0060.0388.11
5.1.40.0030.0398.09
5.1.30.0080.0468.44
5.1.20.0140.0368.46
5.1.10.0070.0388.20
5.1.00.0100.0398.20
5.0.50.0080.0256.67
5.0.40.0050.0296.53
5.0.30.0090.0416.34
5.0.20.0070.0266.30
5.0.10.0040.0306.29
5.0.00.0050.0416.28
4.4.90.0080.0254.78
4.4.80.0040.0174.75
4.4.70.0090.0174.75
4.4.60.0040.0234.75
4.4.50.0070.0274.77
4.4.40.0090.0304.71
4.4.30.0050.0244.76
4.4.20.0020.0294.85
4.4.10.0050.0254.85
4.4.00.0040.0394.75
4.3.110.0090.0284.67
4.3.100.0060.0304.67
4.3.90.0040.0264.64
4.3.80.0040.0364.58
4.3.70.0030.0224.63
4.3.60.0050.0234.63
4.3.50.0030.0324.63
4.3.40.0060.0314.53
4.3.30.0050.0293.31
4.3.20.0060.0393.29
4.3.10.0080.0453.25
4.3.00.0070.01743.99

preferences:
38.85 ms | 401 KiB | 5 Q