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.40.0070.00718.96
8.3.30.0110.00719.26
8.3.20.0060.00320.16
8.3.10.0000.00823.71
8.3.00.0050.00319.03
8.2.170.0110.00722.96
8.2.160.0130.00020.35
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0050.00220.75
8.2.110.0060.00321.07
8.2.100.0070.00418.03
8.2.90.0040.00419.28
8.2.80.0040.00417.97
8.2.70.0060.00317.74
8.2.60.0040.00417.93
8.2.50.0080.00418.10
8.2.40.0040.00418.34
8.2.30.0000.00718.35
8.2.20.0000.00717.71
8.2.10.0030.00518.19
8.2.00.0000.00717.75
8.1.270.0030.00723.96
8.1.260.0030.00526.35
8.1.250.0080.00028.09
8.1.240.0060.00321.48
8.1.230.0070.00417.58
8.1.220.0080.00017.74
8.1.210.0030.00518.77
8.1.200.0030.00717.35
8.1.190.0050.00317.36
8.1.180.0050.00518.10
8.1.170.0030.00518.59
8.1.160.0040.00422.06
8.1.150.0000.00718.65
8.1.140.0040.00417.42
8.1.130.0030.00317.82
8.1.120.0040.00417.49
8.1.110.0070.00317.38
8.1.100.0070.00017.47
8.1.90.0000.00817.40
8.1.80.0000.00817.48
8.1.70.0000.00717.35
8.1.60.0000.00917.54
8.1.50.0000.00817.47
8.1.40.0000.00817.57
8.1.30.0030.00617.73
8.1.20.0000.00817.66
8.1.10.0030.00517.55
8.1.00.0040.00417.57
8.0.300.0040.00418.77
8.0.290.0000.00816.75
8.0.280.0000.00718.47
8.0.270.0050.00317.25
8.0.260.0070.00017.25
8.0.250.0030.00317.05
8.0.240.0000.00716.93
8.0.230.0030.00317.05
8.0.220.0030.00316.89
8.0.210.0070.00016.90
8.0.200.0040.00416.98
8.0.190.0000.00717.04
8.0.180.0040.00416.97
8.0.170.0030.00516.92
8.0.160.0000.00716.93
8.0.150.0050.00316.98
8.0.140.0000.00716.87
8.0.130.0050.00013.40
8.0.120.0040.00417.06
8.0.110.0080.00016.99
8.0.100.0050.00316.89
8.0.90.0040.00416.97
8.0.80.0000.01416.93
8.0.70.0080.00016.85
8.0.60.0040.00416.84
8.0.50.0000.00816.98
8.0.30.0140.00417.16
8.0.20.0110.01217.40
8.0.10.0000.00716.98
8.0.00.0110.00716.69
7.4.330.0000.00515.00
7.4.320.0030.00316.46
7.4.300.0040.00416.55
7.4.290.0070.00016.53
7.4.280.0070.00016.68
7.4.270.0070.00016.56
7.4.260.0000.00716.38
7.4.250.0040.00416.65
7.4.240.0060.00216.55
7.4.230.0000.00716.67
7.4.220.0130.01316.60
7.4.210.0070.01116.69
7.4.200.0030.00316.34
7.4.190.0030.00316.50
7.4.160.0040.01216.53
7.4.150.0120.01217.40
7.4.140.0120.00517.86
7.4.130.0070.01016.67
7.4.120.0130.00516.60
7.4.110.0160.00616.68
7.4.100.0070.01616.41
7.4.90.0060.01516.71
7.4.80.0090.00919.39
7.4.70.0100.00716.64
7.4.60.0070.01016.59
7.4.50.0000.00916.63
7.4.40.0120.00416.54
7.4.30.0060.01016.51
7.4.00.0060.00814.95
7.3.330.0040.00413.45
7.3.320.0020.00213.45
7.3.310.0070.00016.34
7.3.300.0040.00416.50
7.3.290.0040.01016.50
7.3.280.0060.01216.45
7.3.270.0150.00617.40
7.3.260.0070.01116.43
7.3.250.0120.00716.64
7.3.240.0100.00716.45
7.3.230.0110.00616.66
7.3.210.0160.00616.44
7.3.200.0060.01219.39
7.3.190.0140.00716.41
7.3.180.0090.00916.68
7.3.170.0070.01016.63
7.3.160.0100.00716.39
7.3.120.0060.00915.03
7.3.110.0080.00814.89
7.3.100.0040.01214.88
7.3.90.0040.00814.88
7.3.80.0070.00714.67
7.3.70.0140.00314.93
7.3.60.0090.00615.10
7.3.50.0100.00714.78
7.3.40.0030.01014.87
7.3.30.0040.01114.84
7.3.20.0060.00916.52
7.3.10.0070.00716.70
7.3.00.0110.00716.47
7.2.330.0090.00916.81
7.2.320.0120.00816.41
7.2.310.0070.01016.63
7.2.300.0070.01016.66
7.2.290.0070.01116.82
7.2.250.0100.00715.25
7.2.240.0080.01114.89
7.2.230.0060.01114.81
7.2.220.0150.00015.19
7.2.210.0030.01315.14
7.2.200.0000.01514.81
7.2.190.0070.00315.06
7.2.180.0060.00915.20
7.2.170.0070.00714.91
7.2.60.0060.00917.04
7.2.00.0000.01219.50
7.1.330.0030.01415.71
7.1.320.0030.00615.81
7.1.310.0000.01116.04
7.1.300.0040.00415.91
7.1.290.0000.01015.89
7.1.280.0000.01515.67
7.1.270.0110.00315.77
7.1.260.0030.00615.90
7.1.200.0120.00015.81
7.1.100.0030.01017.87
7.1.70.0060.00617.25
7.1.60.0140.01019.70
7.1.50.0100.01317.02
7.1.00.0030.07722.27
7.0.200.0120.00316.79
7.0.140.0000.07722.23
7.0.60.0100.08019.96
7.0.50.0070.04317.89
7.0.40.0130.07320.05
7.0.30.0370.07320.06
7.0.20.0200.07720.06
7.0.10.0030.04720.17
7.0.00.0070.05720.20
5.6.280.0030.07320.84
5.6.210.0170.07020.58
5.6.200.0030.08318.22
5.6.190.0070.04020.42
5.6.180.0130.07720.78
5.6.170.0200.05020.54
5.6.160.0100.06320.47
5.6.150.0030.04018.14
5.6.140.0100.08018.15
5.6.130.0070.05318.13
5.6.120.0100.06721.01
5.6.110.0070.04721.07
5.6.100.0000.04321.04
5.6.90.0070.05321.14
5.6.80.0070.06320.40
5.5.350.0000.06020.43
5.5.340.0130.07717.98
5.5.330.0030.09320.43
5.5.320.0200.03720.29
5.5.310.0400.04720.25
5.5.300.0030.08717.93
5.5.290.0200.07318.04
5.5.280.0070.08320.82
5.5.270.0030.04320.78
5.5.260.0170.07320.89
5.5.250.0100.08020.57
5.5.240.0100.06320.28
5.4.450.0430.04319.46
5.4.440.0170.03319.41
5.4.430.0230.04719.50
5.4.420.0370.04719.51
5.4.410.0200.03719.04
5.4.400.0270.04751.48
5.4.390.0070.03347.46
5.4.380.0200.05718.74
5.4.370.0200.06318.78
5.4.360.0270.06318.80
5.4.350.0170.05318.84
5.4.340.0170.05318.59
5.4.320.0010.04212.52
5.4.310.0040.04012.52
5.4.300.0060.04412.52
5.4.290.0050.04712.52
5.4.280.0090.04512.42
5.4.270.0090.04112.41
5.4.260.0040.04812.41
5.4.250.0090.04412.41
5.4.240.0090.04512.41
5.4.230.0090.03812.41
5.4.220.0100.03812.40
5.4.210.0100.05812.41
5.4.200.0070.05112.41
5.4.190.0070.04312.41
5.4.180.0040.04212.41
5.4.170.0060.04212.41
5.4.160.0070.04212.41
5.4.150.0060.04312.40
5.4.140.0090.04512.09
5.4.130.0100.04012.08
5.4.120.0050.05012.03
5.4.110.0100.04012.03
5.4.100.0080.04412.03
5.4.90.0120.04012.03
5.4.80.0110.04612.03
5.4.70.0150.05712.03
5.4.60.0080.04612.02
5.4.50.0100.04412.03
5.4.40.0090.04612.01
5.4.30.0050.04912.01
5.4.20.0080.05012.02
5.4.10.0060.06012.01
5.4.00.0120.04711.51
5.3.290.0040.04312.80
5.3.280.0100.04012.71
5.3.270.0080.05712.73
5.3.260.0140.06912.72
5.3.250.0080.04112.72
5.3.240.0060.04512.72
5.3.230.0140.04312.71
5.3.220.0100.04912.68
5.3.210.0100.05112.68
5.3.200.0120.04912.68
5.3.190.0100.05112.68
5.3.180.0170.05612.67
5.3.170.0040.05112.67
5.3.160.0100.06812.67
5.3.150.0150.05512.67
5.3.140.0100.04712.66
5.3.130.0110.05012.66
5.3.120.0100.04912.65
5.3.110.0070.05012.66
5.3.100.0170.08112.14
5.3.90.0080.05012.13
5.3.80.0060.05012.12
5.3.70.0070.05112.12
5.3.60.0060.05412.10
5.3.50.0070.05212.05
5.3.40.0060.05512.05
5.3.30.0110.04712.00
5.3.20.0110.04411.80
5.3.10.0060.05111.75
5.3.00.0080.05111.74
5.2.170.0080.0459.24
5.2.160.0080.0519.24
5.2.150.0090.0449.24
5.2.140.0090.0419.24
5.2.130.0070.0409.20
5.2.120.0050.0419.20
5.2.110.0100.0539.21
5.2.100.0100.0419.21
5.2.90.0130.0299.21
5.2.80.0070.0319.21
5.2.70.0050.0419.20
5.2.60.0090.0379.15
5.2.50.0080.0429.12
5.2.40.0100.0459.10
5.2.30.0120.0369.08
5.2.20.0040.0409.07
5.2.10.0040.0408.97
5.2.00.0070.0528.84
5.1.60.0050.0368.13
5.1.50.0100.0318.12
5.1.40.0040.0398.10
5.1.30.0080.0388.45
5.1.20.0070.0408.47
5.1.10.0060.0398.20
5.1.00.0080.0378.20
5.0.50.0080.0286.68
5.0.40.0080.0396.54
5.0.30.0090.0406.34
5.0.20.0060.0256.31
5.0.10.0040.0306.29
5.0.00.0000.0476.29
4.4.90.0040.0234.78
4.4.80.0050.0214.75
4.4.70.0040.0224.75
4.4.60.0030.0234.75
4.4.50.0040.0224.77
4.4.40.0100.0384.71
4.4.30.0060.0304.76
4.4.20.0030.0294.84
4.4.10.0030.0294.84
4.4.00.0080.0394.76
4.3.110.0050.0274.67
4.3.100.0090.0224.67
4.3.90.0070.0224.63
4.3.80.0090.0354.59
4.3.70.0050.0284.63
4.3.60.0060.0204.63
4.3.50.0040.0264.63
4.3.40.0050.0334.54
4.3.30.0050.0203.31
4.3.20.0030.0213.29
4.3.10.0040.0193.25
4.3.00.0030.02045.53

preferences:
45.19 ms | 400 KiB | 5 Q