3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Contemplate { private static $views = array (); private static $data = array (); private static $content; private function output($buffer) { $search = array( '/\>[^\S ]+/s', //strip whitespaces after tags, except space '/[^\S ]+\</s', //strip whitespaces before tags, except space '/(\s)+/s', // shorten multiple whitespace sequences '/>(\s)+</', ); $replace = array( '>', '<', '\\1', '> <', ); return (preg_replace($search, $replace, $buffer)); } public static function compose($views, array $data = NULL) { /* * render and output page * @param * $views - array of pages to render * $data - array of inject data to pages */ if ($data) { self::$data = $data; } self::$views = $views; extract(self::$data); ob_start(); foreach (self::$views as $value) { require VIEW_PATH . $value . '.php'; } unset($value); self::$content = ob_get_clean(); echo self::output(self::$content); } }//end class

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.0140.00318.75
8.3.30.0180.00318.65
8.3.20.0070.01320.04
8.3.10.0090.00023.71
8.3.00.0050.00320.71
8.2.170.0110.01122.96
8.2.160.0100.01021.96
8.2.150.0080.00024.18
8.2.140.0160.00324.66
8.2.130.0060.00326.16
8.2.120.0090.00921.11
8.2.110.0150.00622.02
8.2.100.0070.00317.47
8.2.90.0040.00418.92
8.2.80.0050.00317.97
8.2.70.0000.00817.25
8.2.60.0000.00817.80
8.2.50.0060.00318.07
8.2.40.0050.00318.22
8.2.30.0000.00717.83
8.2.20.0080.00017.48
8.2.10.0000.00817.59
8.2.00.0040.00417.62
8.1.270.0060.01323.71
8.1.260.0180.00026.35
8.1.250.0070.01028.09
8.1.240.0130.00723.88
8.1.230.0080.00419.06
8.1.220.0000.00817.74
8.1.210.0080.00318.77
8.1.200.0110.00017.35
8.1.190.0050.00317.38
8.1.180.0030.00618.10
8.1.170.0000.00818.39
8.1.160.0000.00721.93
8.1.150.0070.00018.50
8.1.140.0080.00017.22
8.1.130.0030.00317.70
8.1.120.0040.00417.36
8.1.110.0000.00817.24
8.1.100.0000.00717.31
8.1.90.0030.00317.25
8.1.80.0050.00317.33
8.1.70.0000.00717.31
8.1.60.0000.00817.45
8.1.50.0000.00717.32
8.1.40.0070.00017.36
8.1.30.0080.00017.51
8.1.20.0050.00217.54
8.1.10.0030.00617.42
8.1.00.0040.00417.23
8.0.300.0040.00418.77
8.0.290.0070.00017.05
8.0.280.0000.00818.34
8.0.270.0030.00317.11
8.0.260.0030.00316.72
8.0.250.0030.00316.88
8.0.240.0040.00416.73
8.0.230.0040.00416.79
8.0.220.0050.00216.75
8.0.210.0000.00716.79
8.0.200.0030.00316.75
8.0.190.0060.00316.91
8.0.180.0000.00716.72
8.0.170.0000.00816.70
8.0.160.0080.00016.79
8.0.150.0040.00416.61
8.0.140.0050.00216.64
8.0.130.0030.00313.17
8.0.120.0040.00416.67
8.0.110.0000.00716.77
8.0.100.0000.00816.59
8.0.90.0070.00016.64
8.0.80.0040.01616.80
8.0.70.0040.00416.64
8.0.60.0000.00716.77
8.0.50.0070.00016.61
8.0.30.0140.00516.84
8.0.20.0090.00917.40
8.0.10.0040.00416.74
8.0.00.0100.00816.56
7.4.330.0000.00515.00
7.4.320.0030.00316.46
7.4.300.0000.00616.40
7.4.290.0000.00716.54
7.4.280.0070.00016.28
7.4.270.0000.00716.41
7.4.260.0000.00716.38
7.4.250.0050.00216.28
7.4.240.0040.00416.39
7.4.230.0070.00016.52
7.4.220.0090.00916.45
7.4.210.0070.00916.47
7.4.200.0030.00316.33
7.4.190.0040.00416.34
7.4.160.0080.00816.10
7.4.150.0100.00717.40
7.4.140.0120.00617.86
7.4.130.0070.01116.31
7.4.120.0070.01016.41
7.4.110.0130.01016.18
7.4.100.0180.00016.54
7.4.90.0060.01016.47
7.4.80.0150.00616.51
7.4.70.0100.00716.46
7.4.60.0120.00316.37
7.4.50.0030.00316.20
7.4.40.0000.01122.77
7.4.30.0080.00716.41
7.4.00.0090.00314.67
7.3.330.0030.00413.20
7.3.320.0050.00013.13
7.3.310.0030.00516.12
7.3.300.0030.00316.00
7.3.290.0090.00616.16
7.3.280.0130.00416.20
7.3.270.0100.00717.40
7.3.260.0120.00616.50
7.3.250.0070.01016.36
7.3.240.0060.01216.18
7.3.230.0060.01016.39
7.3.210.0000.01616.33
7.3.200.0070.01019.39
7.3.190.0120.00316.28
7.3.180.0130.00316.38
7.3.170.0030.01216.27
7.3.160.0100.00716.42
7.3.120.0070.01014.95
7.3.00.0040.00816.44
7.2.330.0130.00316.25
7.2.320.0030.01516.50
7.2.310.0080.01116.49
7.2.300.0160.00016.50
7.2.290.0030.01416.54
7.2.130.0090.00916.83
7.2.120.0060.00916.83
7.2.110.0090.00316.60
7.2.100.0100.00716.80
7.2.90.0000.01416.67
7.2.80.0060.00316.86
7.2.70.0080.00416.79
7.2.60.0070.00716.59
7.2.50.0030.01016.32
7.2.40.0090.00316.35
7.2.30.0030.00916.63
7.2.20.0030.00916.58
7.2.10.0110.00716.75
7.2.00.0060.00817.64
7.1.250.0050.00515.50
7.1.240.0140.00015.40
7.1.230.0030.00615.63
7.1.220.0030.00715.60
7.1.210.0120.00315.05
7.1.200.0060.00515.43
7.1.190.0040.00715.46
7.1.180.0070.00415.42
7.1.170.0030.01115.51
7.1.160.0000.01115.47
7.1.150.0060.00615.37
7.1.140.0120.00315.46
7.1.130.0080.00015.63
7.1.120.0070.00715.42
7.1.110.0040.01115.71
7.1.100.0060.00716.79
7.1.90.0030.00615.48
7.1.80.0030.00615.55
7.1.70.0070.00716.32
7.1.60.0050.01317.43
7.1.50.0090.00716.10
7.1.40.0070.00415.52
7.1.30.0040.00815.64
7.1.20.0000.01015.07
7.1.10.0060.00615.48
7.1.00.0070.03718.94
7.0.330.0070.00315.03
7.0.320.0040.00415.15
7.0.310.0030.00915.21
7.0.300.0030.00915.02
7.0.290.0030.00815.24
7.0.280.0030.00615.13
7.0.270.0030.00715.35
7.0.260.0000.00915.17
7.0.250.0100.00315.04
7.0.240.0040.00715.19
7.0.230.0000.01115.32
7.0.220.0090.00015.04
7.0.210.0030.01014.96
7.0.200.0050.00815.94
7.0.190.0040.00815.23
7.0.180.0030.00615.21
7.0.170.0050.00515.29
7.0.160.0030.00614.93
7.0.150.0140.00015.23
7.0.140.0060.03918.59
7.0.130.0070.00715.30
7.0.120.0060.00615.32
7.0.110.0040.00815.22
7.0.100.0120.04617.50
7.0.90.0080.02217.41
7.0.80.0060.04317.49
7.0.70.0120.05017.46
7.0.60.0070.03517.64
7.0.50.0050.02217.80
7.0.40.0070.03716.57
7.0.30.0110.04216.75
7.0.20.0020.06116.78
7.0.10.0080.03716.78
7.0.00.0050.04616.69
5.6.380.0030.01014.01
5.6.370.0000.01814.24
5.6.360.0070.00413.79
5.6.350.0030.01014.23
5.6.340.0040.00713.77
5.6.330.0030.01013.86
5.6.320.0040.01114.21
5.6.310.0000.00814.38
5.6.300.0090.00314.30
5.6.290.0040.00714.24
5.6.280.0100.03517.55
5.6.270.0070.00414.39
5.6.260.0080.00013.98
5.6.250.0100.03117.34
5.6.240.0050.04417.55
5.6.230.0100.02817.29
5.6.220.0080.02517.37
5.6.210.0120.04217.30
5.6.200.0050.02717.52
5.6.190.0070.02217.64
5.6.180.0050.03017.45
5.6.170.0030.02817.54
5.6.160.0030.04717.67
5.6.150.0050.04417.49
5.6.140.0110.03717.56
5.6.130.0030.03117.62
5.6.120.0130.03817.58
5.6.110.0080.04017.57
5.6.100.0030.02317.52
5.6.90.0070.04217.63
5.6.80.0100.04017.23
5.6.70.0100.03717.34
5.6.60.0070.03217.12
5.6.50.0050.04417.30
5.6.40.0080.03917.16
5.6.30.0060.04017.12
5.6.20.0080.01917.12
5.6.10.0050.04217.34
5.6.00.0120.03717.32
5.5.380.0080.03515.85
5.5.370.0030.03615.79
5.5.360.0070.04215.82
5.5.350.0030.04215.78
5.5.340.0050.03315.98
5.5.330.0080.04316.05
5.5.320.0080.04015.99
5.5.310.0030.02715.98
5.5.300.0070.03016.02
5.5.290.0050.02915.99
5.5.280.0100.04716.04
5.5.270.0070.02016.05
5.5.260.0070.04316.02
5.5.250.0090.03815.86
5.5.240.0050.04715.70
5.5.230.0030.04915.60
5.5.220.0070.03515.59
5.5.210.0030.03715.71
5.5.200.0050.03515.73
5.5.190.0040.04415.71
5.5.180.0050.02015.67
5.5.170.0000.01211.18
5.5.160.0050.02315.73
5.5.150.0050.03015.64
5.5.140.0030.02115.72
5.5.130.0100.03815.66
5.5.120.0050.03415.63
5.5.110.0080.04015.63
5.5.100.0080.03615.67
5.5.90.0050.03315.68
5.5.80.0020.02815.65
5.5.70.0070.04215.62
5.5.60.0050.03915.67
5.5.50.0030.04415.62
5.5.40.0100.02715.57
5.5.30.0050.03315.60
5.5.20.0070.03715.55
5.5.10.0070.03315.64
5.5.00.0030.02315.61
5.4.450.0070.02515.19
5.4.440.0030.02815.27
5.4.430.0070.04215.26
5.4.420.0070.04515.31
5.4.410.0020.03915.29
5.4.400.0080.04015.15
5.4.390.0040.02215.10
5.4.380.0030.04015.15
5.4.370.0050.04515.17
5.4.360.0070.02415.02
5.4.350.0020.02515.10
5.4.340.0060.03615.15
5.4.330.0050.00311.18
5.4.320.0020.03715.16
5.4.310.0100.03215.10
5.4.300.0100.02715.01
5.4.290.0050.03615.20
5.4.280.0050.03615.10
5.4.270.0020.04315.04
5.4.260.0050.04215.03
5.4.250.0070.03815.12
5.4.240.0070.03915.19
5.4.230.0080.04515.13
5.4.220.0070.04015.01
5.4.210.0060.03615.05
5.4.200.0030.04215.11
5.4.190.0090.02315.02
5.4.180.0060.02015.05
5.4.170.0080.04315.17
5.4.160.0050.04115.10
5.4.150.0000.02615.10
5.4.140.0030.02213.75
5.4.130.0080.01513.83
5.4.120.0050.03613.81
5.4.110.0060.02813.75
5.4.100.0070.04413.80
5.4.90.0010.03713.78
5.4.80.0060.03013.84
5.4.70.0080.02913.76
5.4.60.0050.02413.75
5.4.50.0050.03813.75
5.4.40.0050.02113.85
5.4.30.0070.01813.81
5.4.20.0080.03313.80
5.4.10.0060.03513.79
5.4.00.0080.03613.52
5.3.290.0050.04312.96
5.3.280.0110.03212.96
5.3.270.0020.02312.90
5.3.260.0030.02212.94
5.3.250.0040.02012.87
5.3.240.0060.03712.93
5.3.230.0020.04112.92
5.3.220.0050.03812.85
5.3.210.0030.03812.93
5.3.200.0080.03812.90
5.3.190.0090.04012.88
5.3.180.0070.03512.86
5.3.170.0030.04112.94
5.3.160.0080.03712.84
5.3.150.0100.03512.90
5.3.140.0030.03412.90
5.3.130.0030.02812.87
5.3.120.0020.04012.85
5.3.110.0030.02512.85
5.3.100.0030.03312.59
5.3.90.0020.04512.63
5.3.80.0050.03812.62
5.3.70.0020.02512.57
5.3.60.0020.04012.54
5.3.50.0050.03812.62
5.3.40.0050.02212.51
5.3.30.0070.04012.54
5.3.20.0030.02312.40
5.3.10.0020.03412.44
5.3.00.0030.02512.42
5.2.170.0030.02811.64
5.2.160.0050.01511.64
5.2.150.0000.03611.64
5.2.140.0070.02211.64
5.2.130.0020.02011.64
5.2.120.0070.02811.64
5.2.110.0070.03311.64
5.2.100.0050.02511.64
5.2.90.0060.02511.64
5.2.80.0000.02811.64
5.2.70.0030.03011.64
5.2.60.0080.01711.64
5.2.50.0050.02011.64
5.2.40.0080.02811.64
5.2.30.0030.03211.64
5.2.20.0030.02811.64
5.2.10.0050.02811.64
5.2.00.0050.02811.64
5.1.60.0020.01611.64
5.1.50.0020.02211.64
5.1.40.0030.02511.64
5.1.30.0030.02211.64
5.1.20.0030.01611.64
5.1.10.0070.02611.64
5.1.00.0040.02511.64
5.0.50.0020.01011.64
5.0.40.0040.01011.64
5.0.30.0030.02911.64
5.0.20.0020.01011.64
5.0.10.0060.00811.64
5.0.00.0000.02711.64
4.4.90.0050.02011.64
4.4.80.0030.02111.64
4.4.70.0020.02011.64
4.4.60.0050.01811.64
4.4.50.0020.01911.64
4.4.40.0010.02211.64
4.4.30.0000.01211.64
4.4.20.0010.01811.64
4.4.10.0030.00811.64
4.4.00.0010.02111.64
4.3.110.0020.01611.64
4.3.100.0000.01311.64
4.3.90.0020.01411.64
4.3.80.0020.01311.64
4.3.70.0030.01311.64
4.3.60.0020.01311.64
4.3.50.0000.01111.64
4.3.40.0020.02211.64
4.3.30.0020.01811.64
4.3.20.0000.01411.64
4.3.10.0030.00711.64
4.3.00.0040.01211.64

preferences:
51.25 ms | 400 KiB | 5 Q