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() { $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.0170.00318.55
8.3.50.0120.00521.98
8.3.40.0120.00318.92
8.3.30.0030.01419.18
8.3.20.0040.00420.21
8.3.10.0080.00023.57
8.3.00.0040.00419.02
8.2.180.0070.01416.63
8.2.170.0040.01122.96
8.2.160.0070.00720.27
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0000.00820.79
8.2.110.0150.00422.10
8.2.100.0090.00317.78
8.2.90.0000.00818.34
8.2.80.0090.00017.97
8.2.70.0040.00417.77
8.2.60.0000.00818.05
8.2.50.0040.00419.56
8.2.40.0000.00822.35
8.2.30.0000.00718.32
8.2.20.0050.00317.88
8.2.10.0040.00418.04
8.2.00.0040.00417.85
8.1.280.0090.00625.92
8.1.270.0090.00024.02
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0050.00523.74
8.1.230.0060.00620.93
8.1.220.0040.00417.74
8.1.210.0000.00919.09
8.1.200.0060.00317.36
8.1.190.0030.00517.35
8.1.180.0030.00518.10
8.1.170.0030.00518.50
8.1.160.0040.00422.02
8.1.150.0040.00418.63
8.1.140.0000.00717.47
8.1.130.0040.00417.76
8.1.120.0030.00517.46
8.1.110.0030.00617.54
8.1.100.0020.00517.49
8.1.90.0050.00317.49
8.1.80.0000.00717.49
8.1.70.0040.00417.34
8.1.60.0050.00317.61
8.1.50.0040.00417.54
8.1.40.0040.00417.40
8.1.30.0060.00317.70
8.1.20.0070.00017.57
8.1.10.0030.00617.60
8.1.00.0040.00417.52
8.0.300.0000.00820.06
8.0.290.0060.00316.75
8.0.280.0030.00318.39
8.0.270.0030.00317.20
8.0.260.0000.00717.33
8.0.250.0000.00616.90
8.0.240.0040.00416.88
8.0.230.0000.00716.98
8.0.220.0070.00016.95
8.0.210.0040.00716.79
8.0.200.0030.00316.85
8.0.190.0000.00716.99
8.0.180.0000.00716.94
8.0.170.0040.00416.95
8.0.160.0080.00016.86
8.0.150.0070.00016.87
8.0.140.0040.00416.90
8.0.130.0000.00613.37
8.0.120.0040.00416.84
8.0.110.0020.00516.93
8.0.100.0030.00616.71
8.0.90.0040.00417.04
8.0.80.0100.00516.91
8.0.70.0040.00416.79
8.0.60.0040.00416.79
8.0.50.0000.00816.91
8.0.30.0160.00417.30
8.0.20.0130.00817.40
8.0.10.0070.00017.11
8.0.00.0090.00816.88
7.4.330.0020.00215.00
7.4.320.0030.00316.68
7.4.300.0030.00316.42
7.4.290.0000.00716.46
7.4.280.0040.00416.55
7.4.270.0040.00416.61
7.4.260.0050.00216.41
7.4.250.0000.00816.55
7.4.240.0010.00616.60
7.4.230.0050.00216.66
7.4.220.0150.00716.45
7.4.210.0070.00716.48
7.4.200.0030.00316.64
7.4.190.0040.00216.67
7.4.160.0130.00316.79
7.4.150.0110.00717.40
7.4.140.0090.00817.86
7.4.130.0070.01016.54
7.4.120.0080.00916.53
7.4.110.0090.00916.65
7.4.100.0110.01116.46
7.4.90.0110.00716.53
7.4.80.0140.00319.39
7.4.70.0060.01216.48
7.4.60.0100.01016.59
7.4.50.0060.00316.29
7.4.40.0140.00916.34
7.4.30.0100.00716.66
7.4.00.0030.01314.81
7.3.330.0070.00013.25
7.3.320.0050.00013.41
7.3.310.0080.00016.44
7.3.300.0030.00316.26
7.3.290.0100.00716.36
7.3.280.0100.00616.41
7.3.270.0140.00317.40
7.3.260.0120.00616.62
7.3.250.0040.01316.59
7.3.240.0160.00316.41
7.3.230.0080.00816.39
7.3.210.0100.00716.32
7.3.200.0130.01019.39
7.3.190.0120.00616.65
7.3.180.0060.01016.35
7.3.170.0060.01516.39
7.3.160.0090.00616.48
7.3.120.0060.00914.59
7.2.330.0100.00716.59
7.2.320.0050.01316.73
7.2.310.0110.00616.62
7.2.300.0030.01416.75
7.2.290.0250.00016.43
7.2.00.0090.00619.49
7.1.100.0040.00718.03
7.1.70.0000.01217.30
7.1.60.0070.01019.70
7.1.50.0130.01734.84
7.1.00.0030.07722.44
7.0.200.0040.00916.73
7.0.140.0100.06722.09
7.0.60.0070.07319.97
7.0.50.0070.07717.89
7.0.40.0070.08720.13
7.0.30.0130.05020.23
7.0.20.0230.06020.33
7.0.10.0200.03720.26
7.0.00.0100.08320.25
5.6.280.0030.07321.02
5.6.210.0000.07320.66
5.6.200.0070.05718.16
5.6.190.0130.03320.41
5.6.180.0030.05020.57
5.6.170.0200.03720.56
5.6.160.0130.05720.61
5.6.150.0030.07718.25
5.6.140.0000.04318.21
5.6.130.0000.04718.28
5.6.120.0200.04021.02
5.6.110.0130.06321.14
5.6.100.0030.04020.90
5.6.90.0130.08020.99
5.6.80.0030.04020.40
5.6.70.0300.07020.39
5.5.350.0030.08320.51
5.5.340.0070.06717.94
5.5.330.0000.04320.37
5.5.320.0370.04720.30
5.5.310.0330.07020.32
5.5.300.0070.04017.94
5.5.290.0000.04318.00
5.5.280.0100.08020.99
5.5.270.0030.07720.82
5.5.260.0100.08020.79
5.5.250.0130.03320.57
5.5.240.0100.05720.17
5.4.450.0470.03319.49
5.4.440.0500.03719.46
5.4.430.0830.04019.48
5.4.420.0430.04319.27
5.4.410.0330.04019.39
5.4.400.0430.04349.74
5.4.390.0370.04746.74
5.4.380.0230.05018.80
5.4.370.0170.05318.74
5.4.360.0130.05318.76
5.4.350.0230.05718.76
5.4.340.0170.06318.58
5.4.320.0040.03912.53
5.4.310.0060.03912.52
5.4.300.0130.05512.52
5.4.290.0110.05312.52
5.4.280.0070.05512.42
5.4.270.0110.05812.42
5.4.260.0080.04512.41
5.4.250.0160.04112.41
5.4.240.0110.03812.41
5.4.230.0070.04112.41
5.4.220.0050.04412.41
5.4.210.0080.03912.41
5.4.200.0050.04212.41
5.4.190.0100.04112.40
5.4.180.0070.04112.40
5.4.170.0080.04012.41
5.4.160.0090.03612.41
5.4.150.0060.05212.41
5.4.140.0110.04412.09
5.4.130.0100.04212.07
5.4.120.0050.03912.04
5.4.110.0110.03212.03
5.4.100.0050.03812.04
5.4.90.0070.03912.03
5.4.80.0090.05012.03
5.4.70.0080.04812.03
5.4.60.0100.04512.03
5.4.50.0130.04412.03
5.4.40.0080.05012.02
5.4.30.0070.05312.02
5.4.20.0120.06512.01
5.4.10.0140.05812.02
5.4.00.0070.05911.50
5.3.290.0030.04612.80
5.3.280.0200.06712.71
5.3.270.0140.05912.73
5.3.260.0170.08612.72
5.3.250.0090.08512.72
5.3.240.0090.06312.72
5.3.230.0110.05812.71
5.3.220.0140.07012.68
5.3.210.0150.07612.68
5.3.200.0210.12812.68
5.3.190.0160.04712.68
5.3.180.0110.06912.68
5.3.170.0170.06912.66
5.3.160.0170.06212.67
5.3.150.0060.04212.67
5.3.140.0070.04012.66
5.3.130.0100.06212.66
5.3.120.0050.05612.66
5.3.110.0100.07212.66
5.3.100.0110.05212.13
5.3.90.0130.05112.12
5.3.80.0120.05612.11
5.3.70.0110.04612.11
5.3.60.0100.04912.09
5.3.50.0120.04612.05
5.3.40.0100.05712.05
5.3.30.0170.05212.00
5.3.20.0120.04711.79
5.3.10.0080.03711.75
5.3.00.0070.03811.73
5.2.170.0040.0339.24
5.2.160.0090.0349.24
5.2.150.0040.0359.24
5.2.140.0070.0329.24
5.2.130.0060.0359.20
5.2.120.0060.0429.20
5.2.110.0060.0329.21
5.2.100.0070.0309.21
5.2.90.0060.0319.20
5.2.80.0060.0329.20
5.2.70.0080.0329.20
5.2.60.0050.0369.15
5.2.50.0060.0319.12
5.2.40.0060.0359.09
5.2.30.0060.0319.07
5.2.20.0070.0329.07
5.2.10.0050.0328.97
5.2.00.0070.0338.84
5.1.60.0060.0288.12
5.1.50.0080.0278.11
5.1.40.0060.0278.10
5.1.30.0040.0328.45
5.1.20.0070.0368.47
5.1.10.0080.0398.20
5.1.00.0060.0288.20
5.0.50.0070.0206.67
5.0.40.0070.0206.52
5.0.30.0050.0436.34
5.0.20.0060.0256.31
5.0.10.0040.0216.29
5.0.00.0060.0306.28
4.4.90.0020.0174.78
4.4.80.0030.0154.76
4.4.70.0050.0184.75
4.4.60.0030.0164.75
4.4.50.0040.0154.77
4.4.40.0030.0264.70
4.4.30.0030.0164.76
4.4.20.0030.0164.84
4.4.10.0040.0154.85
4.4.00.0030.0264.76
4.3.110.0030.0164.66
4.3.100.0030.0164.66
4.3.90.0040.0174.63
4.3.80.0040.0274.58
4.3.70.0030.0164.63
4.3.60.0060.0124.63
4.3.50.0020.0194.62
4.3.40.0020.0284.54
4.3.30.0030.0213.31
4.3.20.0030.0213.29
4.3.10.0030.0203.25
4.3.00.0100.01344.47

preferences:
45.36 ms | 401 KiB | 5 Q