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); class A {} $a = "A"; $obj = new $$a();

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.43
8.3.50.0100.00722.00
8.3.40.0120.00318.63
8.3.30.0100.00319.19
8.3.20.0080.00020.34
8.3.10.0030.00523.70
8.3.00.0050.00319.14
8.2.180.0120.00425.92
8.2.170.0130.00719.07
8.2.160.0000.01322.96
8.2.150.0080.00025.66
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00020.88
8.2.110.0030.00620.34
8.2.100.0060.00617.79
8.2.90.0040.00417.75
8.2.80.0030.00517.97
8.2.70.0030.00617.93
8.2.60.0000.00817.93
8.2.50.0060.00319.77
8.2.40.0040.00422.32
8.2.30.0040.00418.34
8.2.20.0000.00717.88
8.2.10.0040.00418.01
8.2.00.0000.00817.89
8.1.280.0070.01125.92
8.1.270.0060.00323.97
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00022.10
8.1.230.0080.00818.91
8.1.220.0090.00017.78
8.1.210.0090.00018.77
8.1.200.0100.00017.47
8.1.190.0000.00817.23
8.1.180.0000.00918.10
8.1.170.0060.00318.64
8.1.160.0040.00422.03
8.1.150.0050.00318.73
8.1.140.0040.00417.48
8.1.130.0040.00417.86
8.1.120.0070.00017.39
8.1.110.0070.00317.56
8.1.100.0030.00317.50
8.1.90.0000.00717.37
8.1.80.0020.00517.41
8.1.70.0000.00817.40
8.1.60.0050.00317.46
8.1.50.0040.00417.54
8.1.40.0080.00017.50
8.1.30.0060.00317.64
8.1.20.0000.00817.51
8.1.10.0070.00017.50
8.1.00.0040.00417.42
8.0.300.0030.00619.77
8.0.290.0060.00316.75
8.0.280.0000.00718.38
8.0.270.0030.00317.20
8.0.260.0000.00617.34
8.0.250.0030.00316.95
8.0.240.0040.00417.07
8.0.230.0000.00717.01
8.0.220.0070.00016.87
8.0.210.0040.00716.99
8.0.200.0030.00317.03
8.0.190.0050.00217.02
8.0.180.0040.00416.96
8.0.170.0040.00417.02
8.0.160.0000.00716.90
8.0.150.0040.00416.82
8.0.140.0000.00716.91
8.0.130.0030.00313.45
8.0.120.0000.00816.99
8.0.110.0000.00816.95
8.0.100.0000.00716.85
8.0.90.0050.00316.88
8.0.80.0000.01516.89
8.0.70.0050.00316.91
8.0.60.0070.00016.94
8.0.50.0040.00417.04
8.0.30.0080.01117.13
8.0.20.0110.00817.40
8.0.10.0000.00716.93
8.0.00.0130.00816.90
7.4.330.0000.00515.00
7.4.320.0000.00616.61
7.4.300.0040.00416.52
7.4.290.0030.00316.53
7.4.280.0050.00316.43
7.4.270.0030.00316.59
7.4.260.0000.00816.50
7.4.250.0060.00316.62
7.4.240.0020.00516.57
7.4.230.0000.00716.51
7.4.220.0190.00416.58
7.4.210.0070.00716.43
7.4.200.0000.00816.42
7.4.190.0030.00316.49
7.4.160.0090.00616.55
7.4.150.0140.00317.40
7.4.140.0100.00717.86
7.4.130.0090.00716.62
7.4.120.0070.01016.57
7.4.110.0120.00616.52
7.4.100.0110.01016.48
7.4.90.0120.00616.57
7.4.80.0060.01019.39
7.4.70.0100.00716.77
7.4.60.0180.00316.52
7.4.50.0030.00616.47
7.4.40.0100.01216.50
7.4.30.0040.01316.66
7.4.00.0070.00815.12
7.3.330.0040.00313.28
7.3.320.0030.00213.39
7.3.310.0000.00816.48
7.3.300.0060.00016.43
7.3.290.0030.01016.48
7.3.280.0110.00716.47
7.3.270.0070.01017.40
7.3.260.0120.00616.61
7.3.250.0180.00516.44
7.3.240.0130.00716.69
7.3.230.0060.01016.41
7.3.210.0090.00916.53
7.3.200.0150.00819.39
7.3.190.0140.00716.63
7.3.180.0170.00016.36
7.3.170.0110.01116.56
7.3.160.0120.00416.45
7.3.120.0040.01214.96
7.3.110.0070.00715.02
7.3.100.0000.01714.89
7.3.90.0060.00915.14
7.3.80.0030.01014.85
7.3.70.0120.00314.99
7.3.60.0100.00314.69
7.3.50.0000.00914.95
7.3.40.0040.00414.60
7.3.30.0050.00514.73
7.3.20.0060.00616.69
7.3.10.0040.00916.84
7.3.00.0030.00816.59
7.2.330.0120.00616.56
7.2.320.0130.00416.61
7.2.310.0100.00716.66
7.2.300.0100.00616.69
7.2.290.0130.01216.77
7.2.250.0130.00714.95
7.2.240.0170.00015.09
7.2.230.0040.01115.13
7.2.220.0070.00714.96
7.2.210.0080.00414.94
7.2.200.0050.00515.12
7.2.190.0110.00314.81
7.2.180.0030.00815.01
7.2.170.0060.00915.15
7.2.130.0070.00716.66
7.2.120.0130.00016.82
7.2.110.0000.01516.88
7.2.100.0030.00716.94
7.2.90.0090.00616.98
7.2.80.0110.00316.66
7.2.70.0070.00716.73
7.2.60.0080.00716.67
7.2.50.0030.01416.94
7.2.40.0110.00416.89
7.2.30.0090.00316.76
7.2.20.0070.00716.96
7.2.10.0060.00616.79
7.2.00.0060.00918.16
7.1.330.0060.01015.75
7.1.320.0100.00715.78
7.1.310.0040.00415.94
7.1.300.0080.00515.89
7.1.290.0040.00715.88
7.1.280.0040.01115.68
7.1.270.0090.00015.86
7.1.260.0070.00715.64
7.1.250.0040.01115.84
7.1.200.0030.00715.66
7.1.100.0000.01018.34
7.1.70.0040.00417.24
7.1.60.0140.01119.70
7.1.50.0180.00734.56
7.1.00.0000.08022.46
7.0.200.0030.00716.72
7.0.140.0000.07722.08
7.0.60.0130.08019.95
7.0.50.0100.07717.86
7.0.40.0100.05320.18
7.0.30.0200.07720.26
7.0.20.0330.07720.07
7.0.10.0170.04020.22
7.0.00.0030.04320.23
5.6.280.0070.07321.00
5.6.210.0030.05320.64
5.6.200.0000.07318.21
5.6.190.0030.04320.48
5.6.180.0030.08320.46
5.6.170.0200.04720.51
5.6.160.0100.06020.46
5.6.150.0030.08318.14
5.6.140.0030.04018.13
5.6.130.0030.04318.16
5.6.120.0030.08721.02
5.6.110.0070.04021.00
5.6.100.0030.04021.13
5.6.90.0170.07321.02
5.6.80.0100.06720.55
5.6.70.0230.06020.30
5.5.350.0030.08320.46
5.5.340.0130.06317.98
5.5.330.0100.03720.27
5.5.320.0600.05720.51
5.5.310.0270.08020.27
5.5.300.0030.07718.06
5.5.290.0000.08017.94
5.5.280.0100.07720.89
5.5.270.0070.05320.78
5.5.260.0030.08320.91
5.5.250.0130.05720.61
5.5.240.0030.06320.18
5.4.450.0230.05019.32
5.4.440.0470.04719.52
5.4.430.0100.04319.63
5.4.420.0200.03719.30
5.4.410.0300.04019.32
5.4.400.0430.03719.15
5.4.390.0500.04349.63
5.4.380.0200.05018.47
5.4.370.0170.05018.50
5.4.360.0170.05018.75
5.4.350.0200.07018.79
5.4.340.0100.07318.63
5.4.320.0040.03912.52
5.4.310.0070.04412.52
5.4.300.0120.03712.52
5.4.290.0070.04312.52
5.4.280.0070.06412.41
5.4.270.0120.03512.41
5.4.260.0070.04112.41
5.4.250.0080.04012.41
5.4.240.0090.03812.41
5.4.230.0100.03912.41
5.4.220.0090.03912.40
5.4.210.0070.05712.41
5.4.200.0070.04812.41
5.4.190.0120.04212.40
5.4.180.0080.04612.40
5.4.170.0090.05212.42
5.4.160.0110.05712.41
5.4.150.0090.05412.40
5.4.140.0120.06312.09
5.4.130.0120.04912.08
5.4.120.0060.05012.04
5.4.110.0060.04312.03
5.4.100.0120.03812.03
5.4.90.0090.04512.03
5.4.80.0040.04312.03
5.4.70.0090.04912.03
5.4.60.0080.04812.02
5.4.50.0130.04412.03
5.4.40.0090.05212.02
5.4.30.0120.05212.02
5.4.20.0200.05512.01
5.4.10.0060.04812.02
5.4.00.0080.04611.50
5.3.290.0070.03812.80
5.3.280.0170.11612.71
5.3.270.0120.07612.72
5.3.260.0210.08412.72
5.3.250.0060.05212.72
5.3.240.0100.04412.72
5.3.230.0090.04112.71
5.3.220.0120.03512.68
5.3.210.0070.04512.68
5.3.200.0110.03312.68
5.3.190.0100.04712.68
5.3.180.0080.04812.67
5.3.170.0080.05212.67
5.3.160.0060.05212.67
5.3.150.0090.06012.67
5.3.140.0080.05012.66
5.3.130.0130.06512.66
5.3.120.0150.09112.65
5.3.110.0090.05212.66
5.3.100.0070.03812.14
5.3.90.0070.03712.12
5.3.80.0060.04112.12
5.3.70.0060.03912.12
5.3.60.0080.03712.10
5.3.50.0040.03812.05
5.3.40.0060.03712.05
5.3.30.0040.03912.01
5.3.20.0110.03611.80
5.3.10.0130.04511.75
5.3.00.0060.04711.75
5.2.170.0070.0299.25
5.2.160.0050.0319.25
5.2.150.0050.0319.25
5.2.140.0030.0339.25
5.2.130.0080.0269.21
5.2.120.0040.0309.20
5.2.110.0070.0289.21
5.2.100.0060.0309.21
5.2.90.0050.0309.21
5.2.80.0050.0309.20
5.2.70.0080.0309.20
5.2.60.0050.0349.16
5.2.50.0040.0349.13
5.2.40.0090.0279.10
5.2.30.0020.0349.08
5.2.20.0060.0299.06
5.2.10.0050.0298.97
5.2.00.0070.0288.84
5.1.60.0030.0278.13
5.1.50.0040.0268.12
5.1.40.0040.0278.10
5.1.30.0090.0478.44
5.1.20.0040.0468.47
5.1.10.0040.0438.20
5.1.00.0110.0378.20
5.0.50.0050.0306.67
5.0.40.0070.0446.54
5.0.30.0050.0406.35
5.0.20.0120.0316.30
5.0.10.0060.0836.29
5.0.00.0070.0526.28
4.4.90.0060.0204.78
4.4.80.0050.0204.76
4.4.70.0050.0184.76
4.4.60.0050.0194.75
4.4.50.0030.0214.77
4.4.40.0080.0394.71
4.4.30.0020.0164.75
4.4.20.0010.0224.85
4.4.10.0040.0174.85
4.4.00.0030.0264.76
4.3.110.0020.0184.67
4.3.100.0030.0164.66
4.3.90.0020.0164.63
4.3.80.0040.0244.58
4.3.70.0050.0134.63
4.3.60.0010.0174.63
4.3.50.0010.0194.63
4.3.40.0070.0284.54
4.3.30.0030.0203.31
4.3.20.0010.0193.29
4.3.10.0020.0183.25
4.3.00.0030.01746.75

preferences:
41.38 ms | 401 KiB | 5 Q