3v4l.org

run code in 300+ PHP versions simultaneously
<?php if ( ! isset( $spl_autoloaders ) ) { $spl_autoloaders = array(); } if ( ! function_exists( 'spl_autoload_register' ) ): var_dump( 'using polyfill' ); /** * Autoloader compatibility callback. * * @param string $classname Class to attempt autoloading. */ function __autoload( $classname ) { global $spl_autoloaders; foreach ( $spl_autoloaders as $autoloader ) { call_user_func( $autoloader, $classname ); // If it has been autoloaded, stop processing. if ( class_exists( $classname, false ) ) { return; } } } /** * Register a function to be autoloaded. * * @param callable $autoload_function The function to register. * @param boolean $throw Should the function throw an exception if the function isn't callable? * @param boolean $prepend Should we prepend the function to the stack? */ function spl_autoload_register( $autoload_function, $throw = true, $prepend = false ) { if ( $throw && ! is_callable( $autoload_function ) ) { // String not translated to match PHP core. throw new Exception( 'Function not callable' ); } global $spl_autoloaders; // Don't allow multiple registration. if ( in_array( $autoload_function, $spl_autoloaders ) ) { return; } if ( $prepend ) { array_unshift( $spl_autoloaders, $autoload_function ); } else { $spl_autoloaders[] = $autoload_function; } } /** * Unregister an autoloader function. * * @param callable $function The function to unregister. * @return boolean True if the function was unregistered, false if it could not be. */ function spl_autoload_unregister( $function ) { global $spl_autoloaders; foreach ( $spl_autoloaders as &$autoloader ) { if ( $autoloader === $function ) { unset( $autoloader ); return true; } } return false; } /** * Get the registered autoloader functions. * * @return array List of autoloader functions. */ function spl_autoload_functions() { return $GLOBALS['spl_autoloaders']; } endif; function my_autoloader( $class ) { $path = str_replace( '_', '-', $class ); $path = 'class-' . strtolower( $path ) . '.php'; var_dump( $path ); } spl_autoload_register( 'my_autoloader' ); spl_autoload_register( 'my_autoloader' ); function my_autoloader2( $class ) { $path = str_replace( '_', '/', $class ); $path = 'inc/' . $path . '.php'; var_dump( $path ); } spl_autoload_register( 'my_autoloader2' ); var_dump( class_exists( 'YOLO' ) );

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.0110.00416.50
8.3.50.0000.01418.06
8.3.40.0110.00418.79
8.3.30.0120.00318.59
8.3.20.0040.00420.79
8.3.10.0000.00821.65
8.3.00.0040.00420.84
8.2.180.0070.00718.54
8.2.170.0060.00922.96
8.2.160.0070.00722.08
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0140.00026.16
8.2.120.0030.00720.66
8.2.110.0060.00320.43
8.2.100.0040.00817.80
8.2.90.0040.00418.93
8.2.80.0000.00817.97
8.2.70.0030.00617.50
8.2.60.0080.00017.92
8.2.50.0040.00418.10
8.2.40.0040.00420.55
8.2.30.0050.00220.60
8.2.20.0040.00417.61
8.2.10.0040.00417.83
8.2.00.0030.00517.90
8.1.280.0130.00725.92
8.1.270.0040.00423.96
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0080.00020.91
8.1.230.0000.01217.45
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0060.00317.22
8.1.190.0030.00517.00
8.1.180.0040.00418.10
8.1.170.0050.00318.48
8.1.160.0040.00318.99
8.1.150.0040.00418.75
8.1.140.0070.00019.36
8.1.130.0050.00217.23
8.1.120.0000.00717.40
8.1.110.0050.00217.22
8.1.100.0000.00717.28
8.1.90.0040.00417.23
8.1.80.0020.00517.21
8.1.70.0030.00317.22
8.1.60.0040.00417.34
8.1.50.0030.00517.45
8.1.40.0000.00817.38
8.1.30.0050.00317.59
8.1.20.0040.00417.45
8.1.10.0000.00817.39
8.1.00.0000.00717.19
8.0.300.0050.00518.77
8.0.290.0080.00016.58
8.0.280.0000.00718.19
8.0.270.0000.00716.75
8.0.260.0040.00416.70
8.0.250.0030.00316.79
8.0.240.0070.00016.77
8.0.230.0000.00716.95
8.0.220.0030.00316.71
8.0.210.0070.00016.79
8.0.200.0080.00016.89
8.0.190.0050.00316.86
8.0.180.0000.00716.78
8.0.170.0040.00416.85
8.0.160.0030.00316.73
8.0.150.0040.00416.74
8.0.140.0070.00016.80
8.0.130.0050.00013.26
8.0.120.0040.00416.79
8.0.110.0020.00516.85
8.0.100.0040.00416.72
8.0.90.0020.00516.79
8.0.80.0060.00916.84
8.0.70.0000.00716.67
8.0.60.0040.00416.73
8.0.50.0000.00816.66
8.0.30.0060.01317.07
8.0.20.0100.01017.40
8.0.10.0000.00816.81
8.0.00.0100.00616.61
7.4.330.0030.00316.89
7.4.320.0040.00416.53
7.4.300.0030.00316.46
7.4.290.0000.00716.55
7.4.280.0040.00716.64
7.4.270.0070.00016.62
7.4.260.0000.00716.61
7.4.250.0000.00716.42
7.4.240.0030.00416.48
7.4.230.0000.00716.34
7.4.220.0090.00616.58
7.4.210.0070.00816.63
7.4.200.0070.00016.27
7.4.150.0050.01117.40
7.4.140.0080.01217.86
7.4.130.0110.00616.54
7.4.120.0090.00816.49
7.4.110.0120.01216.42
7.4.100.0070.01116.55
7.4.90.0070.01116.44
7.4.80.0030.01319.39
7.4.70.0130.00316.62
7.4.60.0060.01016.52
7.4.50.0090.00616.60
7.4.40.0090.01316.43
7.4.30.0100.00716.61
7.4.10.0040.01414.94
7.4.00.0080.01015.02
7.3.330.0000.00613.21
7.3.320.0030.00313.41
7.3.310.0040.00416.26
7.3.300.0070.00016.31
7.3.290.0060.01016.38
7.3.280.0110.00616.37
7.3.270.0090.00917.40
7.3.260.0120.00916.55
7.3.250.0110.01016.34
7.3.240.0060.01316.41
7.3.230.0140.00716.42
7.3.210.0130.00316.47
7.3.200.0150.00716.55
7.3.190.0080.00816.66
7.3.180.0070.01016.35
7.3.170.0090.00916.48
7.3.160.0100.00716.43
7.3.130.0110.00715.05
7.3.120.0070.01214.79
7.3.110.0070.00914.88
7.3.100.0030.01114.85
7.3.90.0080.00414.91
7.3.80.0030.00714.77
7.3.70.0050.00714.86
7.3.60.0070.00514.80
7.3.50.0080.00614.84
7.3.40.0050.01114.71
7.3.30.0100.00414.69
7.3.20.0050.01216.71
7.3.10.0060.00916.55
7.3.00.0060.00616.63
7.2.330.0110.01516.48
7.2.320.0060.01616.86
7.2.310.0040.01216.65
7.2.300.0100.00616.70
7.2.290.0090.00916.59
7.2.260.0110.00814.90
7.2.250.0050.01214.96
7.2.240.0080.00715.10
7.2.230.0040.01115.13
7.2.220.0050.00715.07
7.2.210.0030.01214.68
7.2.200.0010.01115.06
7.2.190.0060.00714.95
7.2.180.0070.00915.03
7.2.170.0010.01615.02
7.2.160.0000.01615.22
7.2.150.0030.01316.66
7.2.140.0060.01316.97
7.2.130.0030.01016.90
7.2.120.0050.01616.95
7.2.110.0070.01016.68
7.2.100.0110.00416.75
7.2.90.0050.00916.97
7.2.80.0040.01116.86
7.2.70.0060.00916.89
7.2.60.0070.00816.93
7.2.50.0050.00716.81
7.2.40.0050.00816.85
7.2.30.0080.00716.88
7.2.20.0110.00616.72
7.2.10.0090.00716.94
7.2.00.0080.00517.58
7.1.330.0020.01115.61
7.1.320.0030.01015.65
7.1.310.0050.00715.64
7.1.300.0020.01215.69
7.1.290.0040.00715.80
7.1.280.0040.01215.86
7.1.270.0090.00715.71
7.1.260.0060.00815.72
7.1.250.0070.00715.83
7.1.240.0090.00615.92
7.1.230.0120.00615.55
7.1.220.0000.00915.76
7.1.210.0040.01115.81
7.1.200.0050.00815.74
7.1.190.0000.01415.69
7.1.180.0060.00615.87
7.1.170.0070.01015.48
7.1.160.0100.00315.71
7.1.150.0060.00315.85
7.1.140.0000.01615.77
7.1.130.0000.01015.90
7.1.120.0110.00415.67
7.1.110.0040.00815.94
7.1.100.0020.00816.94
7.1.90.0000.01415.42
7.1.80.0070.00715.54
7.1.70.0030.00916.49
7.1.60.0060.00817.53
7.1.50.0140.01225.22
7.1.40.0070.00715.81
7.1.30.0130.00015.65
7.1.20.0030.00615.72
7.1.10.0080.00815.72
7.1.00.0080.03718.99
7.0.330.0090.00615.46
7.0.320.0030.00915.41
7.0.310.0070.00715.36
7.0.300.0040.01115.45
7.0.290.0090.00615.27
7.0.280.0040.01115.37
7.0.270.0070.00715.40
7.0.260.0040.00415.38
7.0.250.0000.01415.41
7.0.240.0040.01115.49
7.0.230.0030.00515.36
7.0.220.0060.00915.16
7.0.210.0000.00915.42
7.0.200.0070.00915.21
7.0.190.0120.00615.46
7.0.180.0060.00915.10
7.0.170.0030.00915.48
7.0.160.0040.00815.54
7.0.150.0070.00715.27
7.0.140.0000.01415.45
7.0.130.0100.00615.36
7.0.120.0040.01215.47
7.0.110.0090.00015.09
7.0.100.0130.02717.72
7.0.90.0050.01917.65
7.0.80.0040.02017.64
7.0.70.0040.02717.69
7.0.60.0050.02617.68
7.0.50.0180.02417.85
7.0.40.0070.04516.76
7.0.30.0050.04316.83
7.0.20.0020.05016.74
7.0.10.0130.03616.85
7.0.00.0080.04516.72
5.6.400.0060.00613.94
5.6.390.0070.00314.34
5.6.380.0030.00614.54
5.6.370.0090.00614.23
5.6.360.0040.00814.52
5.6.350.0090.00614.35
5.6.340.0070.01014.38
5.6.330.0050.00314.36
5.6.320.0110.00014.60
5.6.310.0000.00814.48
5.6.300.0060.00614.27
5.6.290.0070.01114.30
5.6.280.0020.04217.61
5.6.270.0000.00914.35
5.6.260.0060.00314.11
5.6.250.0030.02717.46
5.6.240.0090.02017.52
5.6.230.0030.02717.46
5.6.220.0070.02017.43
5.6.210.0050.02717.34
5.6.200.0080.03017.55
5.6.190.0020.02917.63
5.6.180.0050.04117.67
5.6.170.0050.04717.75
5.6.160.0090.02917.57
5.6.150.0110.04317.69
5.6.140.0110.04317.63
5.6.130.0100.02517.67
5.6.120.0020.03017.69
5.6.110.0030.04917.57
5.6.100.0100.02517.51
5.6.90.0050.04317.65
5.6.80.0070.02917.25
5.6.70.0070.02617.37
5.6.60.0080.02117.41
5.6.50.0050.04317.08
5.6.40.0100.04017.23
5.6.30.0050.03917.42
5.6.20.0050.03917.48
5.6.10.0040.02717.28
5.6.00.0000.02917.31
5.5.380.0030.02517.45
5.5.370.0070.02317.31
5.5.360.0030.02317.17
5.5.350.0000.04317.16
5.5.340.0130.03017.53
5.5.330.0020.02717.72
5.5.320.0080.03217.51
5.5.310.0100.04217.52
5.5.300.0070.03117.64
5.5.290.0070.03017.65
5.5.280.0080.03917.53
5.5.270.0070.04017.39
5.5.260.0030.03217.72
5.5.250.0050.02717.43
5.5.240.0030.04717.05
5.5.230.0030.04617.26
5.5.220.0060.04317.24
5.5.210.0050.02217.18
5.5.200.0070.03817.14
5.5.190.0070.03817.14
5.5.180.0070.02817.28
5.5.170.0030.00613.95
5.5.160.0020.03017.13
5.5.150.0030.03617.15
5.5.140.0050.04517.26
5.5.130.0080.04317.13
5.5.120.0030.03117.26
5.5.110.0090.03917.16
5.5.100.0080.04117.18
5.5.90.0100.03217.15
5.5.80.0050.03017.13
5.5.70.0070.04217.20
5.5.60.0060.02217.26
5.5.50.0070.03916.96
5.5.40.0020.02917.05
5.5.30.0070.02317.03
5.5.20.0050.02816.99
5.5.10.0110.03417.18
5.5.00.0140.03516.86
5.4.450.0070.04019.39
5.4.440.0130.06319.39
5.4.430.0100.08019.37
5.4.420.0100.07319.44
5.4.410.0100.07319.38
5.4.400.0030.04719.01
5.4.390.0100.05319.07
5.4.380.0100.08019.20
5.4.370.0070.06318.88
5.4.360.0100.07718.95
5.4.350.0000.04319.03
5.4.340.0070.05319.13
5.4.320.0170.05019.12
5.4.310.0130.07019.23
5.4.300.0070.07319.08
5.4.290.0070.03719.08
5.4.280.0130.07019.13
5.4.270.0170.06019.04
5.4.260.0100.04019.21
5.4.250.0130.06719.12
5.4.240.0070.06318.94
5.4.230.0100.05318.89
5.4.220.0130.03719.12
5.4.210.0130.06719.09
5.4.200.0100.06718.94
5.4.190.0070.04019.07
5.4.180.0100.03719.06
5.4.170.0130.07018.90
5.4.160.0130.06719.02
5.4.150.0030.07018.86
5.4.140.0100.04016.26
5.4.130.0000.05716.40
5.4.120.0070.06716.28
5.4.110.0130.07016.49
5.4.100.0030.04316.54
5.4.90.0130.07316.45
5.4.80.0100.03316.43
5.4.70.0130.07016.40
5.4.60.0030.04316.45
5.4.50.0170.03016.45
5.4.40.0070.03316.37
5.4.30.0070.04016.40
5.4.20.0130.05316.36
5.4.10.0130.06016.33
5.4.00.0100.06315.79
5.3.290.0070.07714.67
5.3.280.0100.06014.54
5.3.270.0130.07014.74
5.3.260.0170.06714.71
5.3.250.0070.04714.69
5.3.240.0030.07314.69
5.3.230.0100.03714.61
5.3.220.0070.07714.55
5.3.210.0170.06314.65
5.3.200.0000.04314.58
5.3.190.0100.04714.70
5.3.180.0170.07014.71
5.3.170.0100.04714.57
5.3.160.0030.08014.59
5.3.150.0000.04014.51
5.3.140.0070.06314.58
5.3.130.0070.04014.52
5.3.120.0100.05314.62
5.3.110.0030.06014.56
5.3.100.0070.06014.04
5.3.90.0030.04314.08
5.3.80.0130.06314.15
5.3.70.0100.04314.00
5.3.60.0070.06314.08
5.3.50.0030.04714.01
5.3.40.0070.05313.85
5.3.30.0100.06313.92
5.3.20.0030.07713.65
5.3.10.0000.04313.57
5.3.00.0170.06313.58
5.2.170.0100.06011.23
5.2.160.0130.05011.19
5.2.150.0030.06311.29
5.2.140.0070.05011.16
5.2.130.0030.06311.05
5.2.120.0100.05011.24
5.2.110.0100.05711.21
5.2.100.0100.05711.20
5.2.90.0000.06711.03
5.2.80.0000.06311.14
5.2.70.0100.05311.12
5.2.60.0030.06311.16
5.2.50.0030.04011.16
5.2.40.0070.06011.09
5.2.30.0070.05711.10
5.2.20.0000.06311.04
5.2.10.0100.04310.98
5.2.00.0030.04010.67
5.1.60.0030.03310.09
5.1.50.0070.03010.03
5.1.40.0070.0479.99
5.1.30.0030.04710.38
5.1.20.0100.03310.43
5.1.10.0070.02710.08
5.1.00.0030.04310.18
5.0.50.0100.0308.69
5.0.40.0000.0238.69
5.0.30.0030.0608.69
5.0.20.0000.0478.69
5.0.10.0030.0408.69
5.0.00.0030.0338.69
4.4.90.0030.0178.69
4.4.80.0070.0308.69
4.4.70.0000.0278.69
4.4.60.0030.0338.69
4.4.50.0000.0338.69
4.4.40.0000.0408.69
4.4.30.0030.0308.69
4.4.20.0030.0338.69
4.4.10.0100.0278.69
4.4.00.0030.0278.69
4.3.110.0000.0278.69
4.3.100.0000.0208.69
4.3.90.0000.0378.69
4.3.80.0000.0378.69
4.3.70.0000.0308.69
4.3.60.0070.0138.69
4.3.50.0030.0238.69
4.3.40.0070.0208.69
4.3.30.0000.0308.69
4.3.20.0030.0308.69
4.3.10.0030.0238.69
4.3.00.0030.0308.69

preferences:
61.22 ms | 400 KiB | 5 Q