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' ); function my_autoloader2( $class ) { $path = str_replace( '_', '/', $class ); $path = 'inc/' . $path . '.php'; var_dump( $path ); } spl_autoload_register( 'my_autoloader' ); 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.0040.01116.75
8.3.50.0070.01222.05
8.3.40.0110.00718.76
8.3.30.0120.00318.72
8.3.20.0000.00720.83
8.3.10.0000.00821.65
8.3.00.0050.00320.89
8.2.180.0000.01416.50
8.2.170.0070.00722.96
8.2.160.0070.01020.53
8.2.150.0000.00824.18
8.2.140.0000.00824.66
8.2.130.0080.00019.70
8.2.120.0040.00426.35
8.2.110.0070.00320.91
8.2.100.0090.00317.91
8.2.90.0000.00818.93
8.2.80.0000.00817.97
8.2.70.0040.00417.36
8.2.60.0030.00717.66
8.2.50.0040.00418.10
8.2.40.0030.00522.32
8.2.30.0030.00320.50
8.2.20.0000.00717.46
8.2.10.0070.00018.03
8.2.00.0070.00017.92
8.1.280.0150.00725.92
8.1.270.0080.00023.79
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0090.00023.82
8.1.230.0080.00317.42
8.1.220.0030.00517.74
8.1.210.0040.00418.77
8.1.200.0060.00317.23
8.1.190.0040.00417.11
8.1.180.0000.00818.10
8.1.170.0050.00318.59
8.1.160.0000.00718.85
8.1.150.0040.00418.75
8.1.140.0040.00419.35
8.1.130.0000.00717.64
8.1.120.0040.00417.29
8.1.110.0030.00617.33
8.1.100.0070.00017.38
8.1.90.0000.00817.23
8.1.80.0020.00517.33
8.1.70.0000.00817.32
8.1.60.0000.00817.34
8.1.50.0080.00017.38
8.1.40.0000.00817.43
8.1.30.0000.00817.53
8.1.20.0040.00417.43
8.1.10.0060.00317.41
8.1.00.0000.00817.35
8.0.300.0040.00418.77
8.0.290.0060.00316.75
8.0.280.0030.00318.22
8.0.270.0030.00317.04
8.0.260.0040.00417.20
8.0.250.0030.00316.93
8.0.240.0040.00416.92
8.0.230.0000.00816.80
8.0.220.0030.00316.79
8.0.210.0040.00416.80
8.0.200.0000.00716.84
8.0.190.0000.00716.85
8.0.180.0040.00416.88
8.0.170.0030.00516.85
8.0.160.0040.00416.86
8.0.150.0030.00516.83
8.0.140.0050.00216.66
8.0.130.0040.00413.27
8.0.120.0000.00816.71
8.0.110.0020.00516.89
8.0.100.0040.00416.85
8.0.90.0040.00416.70
8.0.80.0090.00616.86
8.0.70.0020.00516.86
8.0.60.0050.00316.77
8.0.50.0030.00616.78
8.0.30.0040.01316.83
8.0.20.0130.00517.40
8.0.10.0040.00416.99
8.0.00.0150.00316.79
7.4.330.0000.00516.69
7.4.320.0070.00016.50
7.4.300.0030.00316.62
7.4.290.0030.00316.51
7.4.280.0030.00616.61
7.4.270.0070.00016.54
7.4.260.0070.00016.49
7.4.250.0030.00516.49
7.4.240.0040.00416.55
7.4.230.0040.00416.52
7.4.220.0080.00816.66
7.4.210.0150.00016.64
7.4.200.0070.00016.30
7.4.160.0050.01116.37
7.4.150.0080.00817.40
7.4.140.0140.00717.86
7.4.130.0100.01016.64
7.4.120.0120.00616.63
7.4.110.0120.01216.52
7.4.100.0140.00316.59
7.4.90.0030.01416.41
7.4.80.0060.01019.39
7.4.70.0040.01116.34
7.4.60.0060.01016.61
7.4.50.0030.00816.46
7.4.40.0090.00916.43
7.4.30.0140.00316.48
7.4.00.0110.00614.90
7.3.330.0000.00613.25
7.3.320.0050.00013.32
7.3.310.0000.00716.20
7.3.300.0000.00616.34
7.3.290.0100.00616.29
7.3.280.0070.01016.35
7.3.270.0120.01217.40
7.3.260.0100.00916.48
7.3.250.0100.01216.39
7.3.240.0090.00816.34
7.3.230.0120.00416.39
7.3.210.0080.00816.38
7.3.200.0200.00316.32
7.3.190.0120.00416.30
7.3.180.0060.01016.35
7.3.170.0070.01016.50
7.3.160.0130.00616.51
7.3.120.0140.00414.74
7.3.110.0070.01114.82
7.3.100.0090.00614.76
7.3.90.0030.01314.94
7.3.80.0060.00615.01
7.3.70.0040.01114.92
7.3.60.0060.00914.89
7.3.50.0000.01514.54
7.3.40.0070.00714.93
7.3.30.0070.00714.50
7.3.20.0030.00916.52
7.3.10.0080.00316.60
7.3.00.0090.00316.53
7.2.330.0060.01916.82
7.2.320.0060.01616.48
7.2.310.0100.00716.75
7.2.300.0100.00716.65
7.2.290.0060.01216.50
7.2.250.0060.01215.07
7.2.240.0070.01315.10
7.2.230.0060.00915.07
7.2.220.0030.01415.00
7.2.210.0000.01415.05
7.2.200.0110.00415.19
7.2.190.0000.01015.07
7.2.180.0030.01214.99
7.2.170.0080.00814.91
7.2.60.0140.00016.98
7.2.00.0030.00919.66
7.1.330.0040.01115.80
7.1.320.0040.01115.92
7.1.310.0050.00515.82
7.1.300.0040.00815.52
7.1.290.0030.00615.59
7.1.280.0030.01015.85
7.1.270.0040.00415.73
7.1.260.0060.00615.34
7.1.200.0080.00615.86
7.1.100.0040.00818.10
7.1.70.0000.00817.09
7.1.60.0130.01019.32
7.1.50.0230.01234.74
7.1.00.0030.07322.33
7.0.200.0380.00714.78
7.0.60.0700.00020.01
7.0.50.0800.00020.38
7.0.40.0830.00020.26
7.0.30.0770.00020.36
7.0.20.0770.00020.34
7.0.10.0770.00020.34
7.0.00.0770.00020.33
5.6.280.0000.07321.05
5.6.210.0700.00020.71
5.6.200.0830.00021.05
5.6.190.0800.00021.07
5.6.180.0730.00021.07
5.6.170.0730.00021.08
5.6.160.0770.00021.09
5.6.150.0770.00020.98
5.6.140.0970.00021.07
5.6.130.0800.00021.23
5.6.120.0800.00021.09
5.6.110.0770.00021.19
5.6.100.0770.00021.03
5.6.90.0730.00021.07
5.6.80.0730.00020.58
5.6.70.0900.00020.51
5.6.60.0670.00020.39
5.6.50.0730.00020.61
5.6.40.0970.00020.58
5.6.30.0700.00020.34
5.6.20.0800.00020.53
5.6.10.0770.00020.58
5.6.00.0730.00020.52
5.5.350.0700.00020.53
5.5.340.0930.00020.88
5.5.330.0770.00020.76
5.5.320.0730.00021.06
5.5.310.0730.00021.06
5.5.300.0770.00021.05
5.5.290.0800.00020.89
5.5.280.0770.00020.81
5.5.270.0770.00021.01
5.5.260.0830.00020.96
5.5.250.0730.00020.68
5.5.240.0870.00020.11
5.5.230.0730.00020.14
5.5.220.0630.00020.22
5.5.210.0630.00020.14
5.5.200.0700.00020.23
5.5.190.0730.00020.16
5.5.180.0770.00020.31
5.5.160.0870.00020.23
5.5.150.0830.00020.21
5.5.140.0700.00020.08
5.5.130.0800.00020.32
5.5.120.0900.00020.19
5.5.110.0830.00020.22
5.5.100.0930.00020.09
5.5.90.0900.00020.10
5.5.80.0770.00019.97
5.5.70.0700.00020.11
5.5.60.0770.00020.11
5.5.50.0730.00020.11
5.5.40.0700.00020.17
5.5.30.0670.00020.10
5.5.20.0700.00020.13
5.5.10.0930.00020.09
5.5.00.0670.00020.25
5.4.450.0830.00019.37
5.4.440.0700.00019.23
5.4.430.0700.00019.51
5.4.420.0700.00019.23
5.4.410.0700.00019.32
5.4.400.0730.00018.96
5.4.390.0730.00019.12
5.4.380.0730.00019.13
5.4.370.0730.00019.13
5.4.360.0970.00018.98
5.4.350.0770.00018.95
5.4.340.0770.00019.25
5.4.320.0730.00019.26
5.4.310.0670.00019.25
5.4.300.0700.00018.95
5.4.290.0730.00019.13
5.4.280.0930.00019.18
5.4.270.0700.00018.95
5.4.260.0800.00019.24
5.4.250.0870.00018.92
5.4.240.0800.00018.92
5.4.230.0770.00019.17
5.4.220.0730.00019.17
5.4.210.0730.00018.89
5.4.200.0930.00018.90
5.4.190.0700.00019.00
5.4.180.0700.00019.15
5.4.170.0870.00019.11
5.4.160.0630.00019.16
5.4.150.0670.00019.16
5.4.140.0600.00016.47
5.4.130.0600.00016.54
5.4.120.0600.00016.53
5.4.110.0630.00016.52
5.4.100.0600.00016.36
5.4.90.0600.00016.46
5.4.80.0630.00016.53
5.4.70.0570.00016.53
5.4.60.0670.00016.23
5.4.50.0800.00016.51
5.4.40.0630.00016.51
5.4.30.0700.00016.53
5.4.20.0670.00016.51
5.4.10.0630.00016.52
5.4.00.0600.00015.85
5.3.290.0800.00014.79
5.3.280.0700.00014.70
5.3.270.0800.00014.70
5.3.260.0870.00014.70
5.3.250.0630.00014.60
5.3.240.0630.00014.72
5.3.230.0630.00014.58
5.3.220.0630.00014.55
5.3.210.0670.00014.69
5.3.200.0630.00014.52
5.3.190.0630.00014.58
5.3.180.0600.00014.52
5.3.170.0630.00014.45
5.3.160.0630.00014.67
5.3.150.0670.00014.68
5.3.140.0670.00014.60
5.3.130.0800.00014.67
5.3.120.0870.00014.64
5.3.110.0970.00014.64
5.3.100.0900.00014.14
5.3.90.0930.00014.05
5.3.80.0670.00013.93
5.3.70.0630.00014.09
5.3.60.0670.00013.93
5.3.50.0670.00013.86
5.3.40.0700.00013.97
5.3.30.0630.00013.84
5.3.20.0630.00013.79
5.3.10.0670.00013.52
5.3.00.0700.00013.58
5.2.170.0530.00011.22
5.2.160.0570.00011.17
5.2.150.0570.00011.02
5.2.140.0530.00011.02
5.2.130.0500.00011.12
5.2.120.0500.00011.11
5.2.110.0500.00011.21
5.2.100.0500.00011.07
5.2.90.0500.00011.05
5.2.80.0530.00010.96
5.2.70.0530.00011.13
5.2.60.0530.00011.18
5.2.50.0500.00010.96
5.2.40.0500.00011.09
5.2.30.0530.00010.99
5.2.20.0500.00010.95
5.2.10.0500.00010.85
5.2.00.0500.00010.80
5.1.60.0430.00010.00
5.1.50.0430.0009.86
5.1.40.0430.00010.07
5.1.30.0430.00010.31
5.1.20.0470.00010.37
5.1.10.0600.00010.07
5.1.00.0430.0009.94
5.0.50.0330.0008.55
5.0.40.0430.0008.45
5.0.30.0530.0008.36
5.0.20.0400.0008.22
5.0.10.0330.0008.10
5.0.00.0500.0008.29
4.4.90.0300.0005.85
4.4.80.0270.0005.80
4.4.70.0270.0005.84
4.4.60.0270.0005.84
4.4.50.0330.0005.81
4.4.40.0400.0005.80
4.4.30.0270.0005.80
4.4.20.0270.0005.91
4.4.10.0270.0005.89
4.4.00.0400.0005.88
4.3.110.0270.0005.78
4.3.100.0270.0005.78
4.3.90.0270.0005.79
4.3.80.0370.0005.79
4.3.70.0230.0005.77
4.3.60.0270.0005.80
4.3.50.0270.0005.75
4.3.40.0370.0005.71
4.3.30.0230.0005.39
4.3.20.0230.0005.39
4.3.10.0230.0005.39
4.3.00.0230.0005.39

preferences:
57.1 ms | 401 KiB | 5 Q