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(); print_r(get_object_vars($controllerObj)); //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() { $this->books = Book::all(); } function show() { $id = 1; $this->book = 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.0090.00918.89
8.3.30.0150.00019.21
8.3.20.0030.00620.25
8.3.10.0000.00923.47
8.3.00.0080.00019.05
8.2.170.0000.01522.96
8.2.160.0070.00720.43
8.2.150.0030.00524.18
8.2.140.0060.00324.66
8.2.130.0070.00026.16
8.2.120.0050.00320.86
8.2.110.0070.00422.26
8.2.100.0120.00017.91
8.2.90.0040.00417.88
8.2.80.0030.00617.97
8.2.70.0000.00817.91
8.2.60.0050.00318.05
8.2.50.0040.00418.10
8.2.40.0040.00420.65
8.2.30.0040.00418.25
8.2.20.0000.00817.84
8.2.10.0000.00818.21
8.2.00.0090.00017.84
8.1.270.0090.00023.75
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00623.98
8.1.230.0040.00819.09
8.1.220.0000.00817.74
8.1.210.0080.00018.77
8.1.200.0060.00317.35
8.1.190.0060.00317.36
8.1.180.0030.00718.10
8.1.170.0090.00018.51
8.1.160.0000.00822.00
8.1.150.0040.00418.60
8.1.140.0030.00617.48
8.1.130.0050.00317.84
8.1.120.0000.00717.38
8.1.110.0030.00617.48
8.1.100.0000.00717.34
8.1.90.0040.00417.38
8.1.80.0050.00217.46
8.1.70.0030.00317.48
8.1.60.0050.00317.52
8.1.50.0040.00417.45
8.1.40.0030.00517.43
8.1.30.0000.00917.70
8.1.20.0040.00417.71
8.1.10.0040.00417.60
8.1.00.0040.00417.52
8.0.300.0000.00819.65
8.0.290.0040.00416.63
8.0.280.0030.00318.41
8.0.270.0030.00317.30
8.0.260.0000.00617.34
8.0.250.0000.00716.87
8.0.240.0070.00016.86
8.0.230.0070.00016.99
8.0.220.0030.00316.95
8.0.210.0000.00816.96
8.0.200.0000.00616.99
8.0.190.0000.00816.98
8.0.180.0040.00416.87
8.0.170.0040.00416.84
8.0.160.0030.00316.99
8.0.150.0070.00016.90
8.0.140.0000.00816.75
8.0.130.0000.00513.33
8.0.120.0040.00416.78
8.0.110.0080.00016.76
8.0.100.0000.00716.80
8.0.90.0000.00716.73
8.0.80.0060.01016.87
8.0.70.0000.00716.79
8.0.60.0030.00317.04
8.0.50.0040.00416.80
8.0.30.0130.00517.20
8.0.20.0110.01317.40
8.0.10.0070.00016.90
8.0.00.0060.01116.97
7.4.330.0000.00515.00
7.4.320.0030.00316.68
7.4.300.0030.00316.43
7.4.290.0030.00316.49
7.4.280.0040.00416.66
7.4.270.0070.00016.63
7.4.260.0030.00316.44
7.4.250.0000.00816.54
7.4.240.0030.00416.49
7.4.230.0030.00316.57
7.4.220.0080.01216.66
7.4.210.0060.01316.65
7.4.200.0040.00416.70
7.4.190.0070.00016.79
7.4.160.0100.00716.41
7.4.150.0120.00617.40
7.4.140.0100.00717.86
7.4.130.0050.01316.54
7.4.120.0130.00316.65
7.4.110.0090.01316.53
7.4.100.0110.00716.73
7.4.90.0150.00316.54
7.4.80.0080.00919.39
7.4.70.0130.00916.68
7.4.60.0130.00316.59
7.4.50.0030.00616.60
7.4.40.0150.00616.36
7.4.30.0030.01316.48
7.4.00.0120.00414.69
7.3.330.0000.00713.22
7.3.320.0050.00013.24
7.3.310.0000.00716.36
7.3.300.0030.00316.26
7.3.290.0060.01316.46
7.3.280.0090.01216.38
7.3.270.0030.01917.40
7.3.260.0090.01116.39
7.3.250.0110.00916.48
7.3.240.0060.01116.44
7.3.230.0080.01216.39
7.3.210.0150.00616.54
7.3.200.0160.00619.39
7.3.190.0150.00816.54
7.3.180.0030.01316.44
7.3.170.0070.01416.58
7.3.160.0060.01016.66
7.3.120.0090.00615.06
7.3.110.0080.01115.08
7.3.100.0080.00714.86
7.3.90.0020.01014.89
7.3.80.0020.00814.52
7.3.70.0090.00214.87
7.3.60.0090.00514.74
7.3.50.0040.00814.93
7.3.40.0090.00514.73
7.3.30.0090.00514.94
7.3.20.0070.00816.46
7.3.10.0060.00616.65
7.3.00.0060.00916.75
7.2.330.0110.00816.80
7.2.320.0080.01216.54
7.2.310.0070.01016.73
7.2.300.0000.01716.32
7.2.290.0160.00616.55
7.2.250.0060.01115.01
7.2.240.0070.01414.96
7.2.230.0050.00915.07
7.2.220.0070.00314.99
7.2.210.0020.01115.15
7.2.200.0030.00714.92
7.2.190.0010.01114.97
7.2.180.0040.00614.89
7.2.170.0050.00515.00
7.2.00.0130.00019.30
7.1.330.0020.01215.79
7.1.320.0050.00515.89
7.1.310.0040.01015.72
7.1.300.0090.00515.84
7.1.290.0060.00815.77
7.1.280.0070.00815.70
7.1.270.0090.00515.77
7.1.260.0030.00815.90
7.1.100.0050.00518.27
7.1.70.0030.00617.18
7.1.60.0030.02019.70
7.1.50.0170.01434.80
7.1.00.0000.07322.54
7.0.200.0070.00716.83
7.0.140.0000.07722.10
7.0.60.0130.08019.90
7.0.50.0100.07017.88
7.0.40.0170.07020.20
7.0.30.0270.07020.15
7.0.20.0230.08720.10
7.0.10.0100.08320.25
7.0.00.0070.04320.33
5.6.280.0130.06321.10
5.6.210.0070.08020.58
5.6.200.0130.07718.19
5.6.190.0000.05320.52
5.6.180.0270.07320.61
5.6.170.0270.07320.50
5.6.160.0130.07020.62
5.6.150.0030.04318.15
5.6.140.0130.07318.17
5.6.130.0030.08318.23
5.6.120.0070.05021.01
5.6.110.0100.07020.98
5.6.100.0000.04320.91
5.6.90.0030.08021.02
5.6.80.0030.05720.43
5.5.350.0070.06020.46
5.5.340.0130.07317.95
5.5.330.0170.06320.35
5.5.320.0200.08320.35
5.5.310.0470.05020.51
5.5.300.0070.07318.08
5.5.290.0100.07017.96
5.5.280.0070.05320.79
5.5.270.0030.04720.90
5.5.260.0030.08020.99
5.5.250.0100.08720.64
5.5.240.0000.07720.28
5.4.450.0100.04719.64
5.4.440.0400.05319.64
5.4.430.0200.03719.27
5.4.420.0200.04019.48
5.4.410.0270.04019.34
5.4.400.0170.03719.32
5.4.390.0170.03719.16
5.4.380.0170.05018.73
5.4.370.0270.05318.50
5.4.360.0100.08018.74
5.4.350.0200.07018.74
5.4.340.0170.05018.47
5.4.320.0050.05512.52
5.4.310.0080.05012.52
5.4.300.0060.04412.52
5.4.290.0080.04112.52
5.4.280.0080.04312.41
5.4.270.0070.05012.41
5.4.260.0120.05212.41
5.4.250.0080.05512.41
5.4.240.0060.05412.41
5.4.230.0100.04312.41
5.4.220.0110.04712.40
5.4.210.0060.04012.41
5.4.200.0070.04312.40
5.4.190.0060.04412.40
5.4.180.0130.03812.40
5.4.170.0060.04412.42
5.4.160.0060.04712.41
5.4.150.0110.04412.41
5.4.140.0100.04912.09
5.4.130.0050.05112.08
5.4.120.0090.03512.04
5.4.110.0050.04012.04
5.4.100.0070.03612.03
5.4.90.0080.03712.03
5.4.80.0050.04012.03
5.4.70.0100.03512.03
5.4.60.0100.03412.03
5.4.50.0110.03512.03
5.4.40.0100.03912.02
5.4.30.0110.03712.01
5.4.20.0060.03712.02
5.4.10.0040.04512.01
5.4.00.0040.04811.50
5.3.290.0090.03612.80
5.3.280.0070.04112.71
5.3.270.0070.04212.73
5.3.260.0050.04412.72
5.3.250.0070.04512.71
5.3.240.0130.04212.72
5.3.230.0070.04412.70
5.3.220.0060.03912.68
5.3.210.0110.03512.68
5.3.200.0130.03112.68
5.3.190.0100.03612.67
5.3.180.0070.03812.68
5.3.170.0090.04412.67
5.3.160.0100.05412.68
5.3.150.0090.05412.67
5.3.140.0140.04512.66
5.3.130.0080.04312.66
5.3.120.0120.05112.66
5.3.110.0070.04912.66
5.3.100.0090.04212.13
5.3.90.0070.04412.12
5.3.80.0130.03812.11
5.3.70.0030.05512.11
5.3.60.0090.04012.10
5.3.50.0080.03612.05
5.3.40.0090.03912.05
5.3.30.0100.03512.01
5.3.20.0110.04211.79
5.3.10.0080.04211.75
5.3.00.0120.05011.74
5.2.170.0140.0389.24
5.2.160.0050.0529.24
5.2.150.0050.0469.24
5.2.140.0040.0359.24
5.2.130.0130.0529.20
5.2.120.0070.0359.20
5.2.110.0050.0419.20
5.2.100.0110.0499.20
5.2.90.0080.0429.21
5.2.80.0050.0389.20
5.2.70.0070.0329.20
5.2.60.0140.0379.15
5.2.50.0120.0569.11
5.2.40.0100.0399.10
5.2.30.0090.0789.07
5.2.20.0110.0489.06
5.2.10.0060.0318.96
5.2.00.0060.0308.83
5.1.60.0090.0258.12
5.1.50.0060.0298.12
5.1.40.0070.0278.09
5.1.30.0180.0608.45
5.1.20.0070.0268.47
5.1.10.0020.0308.20
5.1.00.0030.0318.20
5.0.50.0070.0276.68
5.0.40.0090.0546.52
5.0.30.0080.0766.34
5.0.20.0180.0516.30
5.0.10.0060.0396.29
5.0.00.0070.0536.28
4.4.90.0080.0324.78
4.4.80.0050.0504.76
4.4.70.0040.0274.75
4.4.60.0020.0184.76
4.4.50.0040.0154.77
4.4.40.0040.0334.71
4.4.30.0050.0154.76
4.4.20.0020.0194.84
4.4.10.0040.0184.85
4.4.00.0050.0434.76
4.3.110.0040.0234.67
4.3.100.0070.0394.67
4.3.90.0070.0354.64
4.3.80.0040.0304.59
4.3.70.0020.0214.63
4.3.60.0060.0154.63
4.3.50.0080.0324.63
4.3.40.0030.0244.54
4.3.30.0080.0443.31
4.3.20.0020.0363.29
4.3.10.0050.0293.25
4.3.00.0070.01316.92

preferences:
57.65 ms | 400 KiB | 5 Q