3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Current Configuration Analyzer * * @since 2.0 * @version 2.0-alpha * @copyright 2009-2014 YOURLS * @license MIT */ namespace YOURLS\Configuration; use YOURLS\Extensions\Filters; class Configuration { /** * Check if an upgrade is needed * */ public function upgrade_is_needed() { // check YOURLS_DB_VERSION exist && match values stored in YOURLS_DB_TABLE_OPTIONS list( $current_ver, $current_sql ) = Environment::current_version(); return $current_sql < YOURLS_DB_VERSION; } /** * * @since 2.0 * @todo Review and PHPDoc */ public static function is( $config ) { if ( defined( 'YOURLS_' . strtoupper( $config ) ) && is_bool( constant( 'YOURLS_' . strtoupper( $config ) ) ) ) { return constant( 'YOURLS_' . strtoupper( $config ) ); } if ( method_exists( $this, 'is_' . $config ) ) { return call_user_func(array( $this, 'is_' . $config ) ); } return false; } /** * Determine if the current page is private * */ public function is_privated() { $private = false; if ( defined( 'YOURLS_PRIVATE' ) && YOURLS_PRIVATE == true ) { // Allow overruling for particular pages: // API if( is_API() ) { if( !defined( 'YOURLS_PRIVATE_API' ) || YOURLS_PRIVATE_API != false ) $private = true; // Infos } elseif( is_infos() ) { if( !defined( 'YOURLS_PRIVATE_INFOS' ) || YOURLS_PRIVATE_INFOS !== false ) $private = true; // Others } else { $private = true; } } return Filters::apply_filter( 'is_private', $private ); } /** * Allow several short URLs for the same long URL ? * */ public function allow_duplicate_longurls() { // special treatment if API to check for WordPress plugin requests if( is_API() ) { if ( isset( $_REQUEST[ 'source' ] ) && $_REQUEST[ 'source' ] == 'plugin' ) return false; } return ( defined( 'UNIQUE_URLS' ) && UNIQUE_URLS == false ); } /** * Check if YOURLS is installed * * @todo Review completely this function with a try catch when connecting database */ public function is_installed() { global $ydb; $is_installed = ( property_exists( $ydb, 'installed' ) && $ydb->installed == true ); return $is_installed; } /** * Check if we'll need interface display function (i.e. not API or redirection) * */ public function has_interface() { return is( 'api' ) || is( 'go' ); } /** * Check if current session is valid and secure as configured * */ public function is_public_or_logged() { if ( !is_privated() ) return true; else return defined( 'YOURLS_USER' ); } /** * Check for maintenance mode. If yes, die. See maintenance_mode(). Stolen from WP. * * @todo Rewrite and fix die */ public function check_maintenance_mode() { $file = YOURLS_ABSPATH . '/.maintenance' ; if ( !file_exists( $file ) || is_upgrading() || is_installing() ) return; global $maintenance_start; include_once( $file ); // If the $maintenance_start timestamp is older than 10 minutes, don't die. if ( ( time() - $maintenance_start ) >= 600 ) return; // Use any /user/maintenance.php file if( file_exists( YOURLS_USERDIR.'/maintenance.php' ) ) { include_once( YOURLS_USERDIR.'/maintenance.php' ); die(); } // https://www.youtube.com/watch?v=Xw-m4jEY-Ns $title = _( 'Service temporarily unavailable' ); $message = _( 'Our service is currently undergoing scheduled maintenance.' ) . "</p><p>" . _( 'Things should not last very long, thank you for your patience and please excuse the inconvenience' ); die( $message/*, $title , 503 */); } }

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.0.110.0040.00416.78
8.0.100.0000.00716.85
8.0.90.0030.00516.68
8.0.80.0070.00716.84
8.0.70.0000.00716.83
8.0.60.0040.00416.75
8.0.50.0080.00016.76
8.0.30.0080.01117.06
8.0.20.0110.00917.40
8.0.10.0000.00716.83
8.0.00.0100.00716.73
7.4.240.0060.00316.48
7.4.230.0030.00316.35
7.4.220.0140.00416.37
7.4.210.0060.01016.51
7.4.200.0040.00416.35
7.4.190.0030.00316.48
7.4.160.0030.01216.30
7.4.150.0060.01217.40
7.4.140.0100.00817.86
7.4.130.0080.00816.38
7.4.120.0090.00916.34
7.4.110.0130.00316.42
7.4.100.0100.00616.61
7.4.90.0110.00716.48
7.4.80.0110.01119.39
7.4.70.0140.00316.33
7.4.60.0090.01216.26
7.4.50.0000.00916.03
7.4.40.0040.01122.77
7.4.30.0060.01116.46
7.4.00.0040.01414.93
7.3.300.0070.00016.21
7.3.290.0060.00916.20
7.3.280.0080.01016.21
7.3.270.0110.00917.40
7.3.260.0140.00416.50
7.3.250.0070.01116.32
7.3.240.0060.01016.24
7.3.230.0060.00916.54
7.3.210.0110.00716.21
7.3.200.0060.01219.39
7.3.190.0080.01116.34
7.3.180.0100.01016.48
7.3.170.0120.00316.50
7.3.160.0060.01016.38
7.3.120.0040.01114.32
7.3.110.0120.00614.76
7.3.100.0000.01314.90
7.3.90.0050.00514.60
7.3.80.0040.00814.93
7.3.70.0040.00414.48
7.3.60.0030.00614.76
7.3.50.0030.01214.75
7.3.40.0110.00314.64
7.3.30.0130.00314.44
7.3.20.0090.00616.64
7.3.10.0050.00516.24
7.3.00.0040.01116.36
7.2.330.0190.00016.53
7.2.320.0100.01516.29
7.2.310.0100.01316.26
7.2.300.0080.01616.32
7.2.290.0100.00616.63
7.2.240.0130.00614.94
7.2.230.0060.00914.76
7.2.220.0110.00414.88
7.2.210.0030.01315.14
7.2.200.0070.01115.00
7.2.190.0040.01114.75
7.2.180.0040.01114.94
7.2.170.0030.01014.75
7.2.160.0000.01515.11
7.2.150.0040.01116.57
7.2.140.0000.00916.62
7.2.130.0100.00716.86
7.2.120.0000.01316.63
7.2.110.0030.00816.47
7.2.100.0120.00316.80
7.2.90.0040.00716.55
7.2.80.0030.00616.57
7.2.70.0050.00516.77
7.2.60.0050.00916.71
7.2.50.0120.00316.74
7.2.40.0110.00316.76
7.2.30.0000.01716.80
7.2.20.0060.00916.49
7.2.10.0030.00716.75
7.2.00.0060.01118.06
7.1.330.0040.01415.25
7.1.320.0000.00815.40
7.1.310.0140.00015.84
7.1.300.0030.01015.53
7.1.290.0000.01515.47
7.1.280.0030.01015.61
7.1.270.0070.00715.70
7.1.260.0040.01115.57
7.1.250.0090.00015.50
7.1.200.0000.01515.59
7.1.100.0000.01717.78
7.1.70.0050.01016.48
7.1.60.0000.02419.82
7.1.50.0000.01716.89
7.1.00.0030.07722.28
7.0.200.0030.00516.65
7.0.140.0100.06722.04
7.0.60.0070.08320.05
7.0.50.0170.07017.97
7.0.40.0000.06020.21
7.0.30.0230.03720.38
7.0.20.0370.07320.19
7.0.10.0100.04020.16
7.0.00.0100.08720.16
5.6.280.0070.07021.19
5.6.210.0130.07320.58
5.6.200.0100.07318.21
5.6.190.0100.05020.79
5.6.180.3730.04020.61
5.6.170.0230.05020.58
5.6.160.0100.08020.49
5.6.150.0030.09318.28
5.6.140.0030.04318.31
5.6.130.0100.08318.22
5.6.120.0070.09021.05
5.6.110.0070.05721.05
5.6.100.0100.08321.07
5.6.90.0070.08021.03
5.6.80.0030.04020.55
5.6.70.4670.04020.51
5.5.350.0230.08320.33
5.5.340.0070.06318.01
5.5.330.0030.04320.38
5.5.320.0300.08020.24
5.5.310.0230.04720.41
5.5.300.0030.04717.97
5.5.290.0000.05017.99
5.5.280.0100.08020.89
5.5.270.0030.09321.01
5.5.260.0130.03321.00
5.5.250.0030.06020.69
5.5.240.0170.06320.27
5.4.450.0070.06719.16
5.4.440.0430.04719.46
5.4.430.0270.06019.45
5.4.420.0300.05719.44
5.4.410.0100.06719.05
5.4.400.0100.05018.90
5.4.390.0070.05318.56
5.4.380.0230.05318.76
5.4.370.0130.05318.56
5.4.360.0130.05018.69
5.4.350.0200.05018.62
5.4.340.0270.04318.77
5.4.320.0040.03812.57
5.4.310.0040.04012.56
5.4.300.0040.04712.57
5.4.290.0080.03812.56
5.4.280.0070.03512.46
5.4.270.0100.05318.85
5.4.260.0130.06318.91
5.4.250.0100.06319.00
5.4.240.0100.07719.06
5.4.230.0200.06319.02
5.4.220.0100.08319.10
5.4.210.0000.08018.93
5.4.200.0230.04319.00
5.4.190.0030.08319.00
5.4.180.0100.05718.97
5.4.170.0070.07719.00
5.4.160.0130.06718.97
5.4.150.0030.07019.09
5.4.140.0130.05016.42
5.4.130.0170.07316.66
5.4.120.0100.06716.41
5.4.110.0100.07316.63
5.4.100.0130.04716.66
5.4.90.0100.04716.58
5.4.80.0030.05316.61
5.4.70.0170.05716.68
5.4.60.0070.07016.68
5.4.50.0130.05016.67
5.4.40.0100.05316.67
5.4.30.0070.05016.61
5.4.20.0130.04016.58
5.4.10.0170.07316.52
5.4.00.0000.07315.97
5.3.290.0070.03812.80
5.3.280.0130.06314.75
5.3.270.0100.05314.73
5.3.260.0030.05714.91
5.3.250.0070.05014.82
5.3.240.0100.05014.81
5.3.230.0170.04314.90
5.3.220.0070.05714.80
5.3.210.0130.05014.82
5.3.200.0100.06714.82
5.3.190.0130.05714.88
5.3.180.0200.05014.88
5.3.170.0170.05314.66
5.3.160.0070.05714.72
5.3.150.0100.07314.82
5.3.140.0200.06314.65
5.3.130.0100.05314.80
5.3.120.0100.05714.78
5.3.110.0070.05314.63
5.3.100.0100.05014.25
5.3.90.0170.06014.35
5.3.80.0030.06314.17
5.3.70.0100.05014.23
5.3.60.0100.07014.32
5.3.50.0070.06714.30
5.3.40.0170.04314.19
5.3.30.0070.06314.11
5.3.20.0100.05713.96
5.3.10.0170.05313.87
5.3.00.0170.04713.93
5.2.170.0130.05011.30
5.2.160.0170.03011.34
5.2.150.0070.05711.07
5.2.140.0030.06011.29
5.2.130.0030.05311.05
5.2.120.0070.05311.08
5.2.110.0000.04710.91
5.2.100.0200.03711.30
5.2.90.0030.04310.91
5.2.80.0070.04011.14
5.2.70.0130.04711.21
5.2.60.0000.04711.25
5.2.50.0070.04011.13
5.2.40.0130.03310.98
5.2.30.0070.04711.17
5.2.20.0070.04311.20
5.2.10.0030.04311.12
5.2.00.0130.05710.95
5.1.60.0030.0379.98
5.1.50.0030.03710.20
5.1.40.0030.04710.26
5.1.30.0100.04010.39
5.1.20.0070.04710.41
5.1.10.0030.03710.26
5.1.00.0070.03710.38
5.0.50.0100.0309.51
5.0.40.0070.0379.51
5.0.30.0030.0609.51
5.0.20.0030.0279.51
5.0.10.0130.0279.51
5.0.00.0000.0479.51
4.4.90.0030.0279.52
4.4.80.0000.0339.51
4.4.70.0000.0239.51
4.4.60.0000.0309.51
4.4.50.0000.0279.51
4.4.40.0070.0409.51
4.4.30.0030.0209.51
4.4.20.0000.0279.51
4.4.10.0000.0339.51
4.4.00.0030.0339.51
4.3.110.0030.0239.51
4.3.100.0100.0139.51
4.3.90.0000.0239.51
4.3.80.0070.0409.51
4.3.70.0000.0279.51
4.3.60.0000.0239.51
4.3.50.0000.0239.51
4.3.40.0070.0379.51
4.3.30.0070.0209.51
4.3.20.0030.0239.51
4.3.10.0070.0209.51
4.3.00.0070.0206.29

preferences:
58.33 ms | 400 KiB | 5 Q