3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Run a million cycles for the profile averages. $cycles = 1000000; // Setup. define( 'WP_PLUGIN_DIR', 'absolute/path/to/the/plugins/dir' ); $plugin = 'plugin/plugin.php'; $plugins_dir = trailingslashit( WP_PLUGIN_DIR ); $plugins_dir_strlen = strlen( $plugins_dir ); // Polyfills. function trailingslashit( $value ) { return untrailingslashit( $value ) . '/'; } function untrailingslashit( $value ) { return rtrim( $value, '/\\' ); } // Test str_replace(). $start_time = microtime( true ); for ( $i = 1; $i <= $cycles; $i++ ) { $plugin_file = str_replace( $plugins_dir, '', $plugin ); } $end_time = microtime( true ); $total_time = ( $end_time - $start_time ) * 1000000.0; printf( "Ran str_replace() in %s microseconds average\n", number_format( $total_time / $cycles, 4 ) ); // Test substr(). $start_time = microtime( true ); for ( $i = 1; $i <= $cycles; $i++ ) { $plugin_file = substr( $plugin, $plugins_dir_strlen ); } $end_time = microtime( true ); $total_time = ( $end_time - $start_time ) * 1000000.0; printf( "Ran substr() in %s microseconds average\n", number_format( $total_time / $cycles, 4 ) );

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.20.0130.09223.48
8.3.10.0160.07923.73
8.3.00.0070.08320.72
8.2.150.0070.07420.73
8.2.140.0130.09122.16
8.2.130.0130.07122.39
8.2.120.0100.07621.21
8.2.110.0100.07220.95
8.2.100.0170.07320.74
8.2.90.0070.07620.69
8.2.80.0100.06720.95
8.2.70.0100.06820.54
8.2.60.0130.06620.49
8.2.50.0070.07020.70
8.2.40.0100.06920.68
8.2.30.0070.07420.48
8.2.20.0130.08920.48
8.2.10.0140.10220.57
8.2.00.0100.06820.41
8.1.270.0030.07624.04
8.1.260.0070.09223.65
8.1.250.0100.08823.88
8.1.240.0160.08918.70
8.1.230.0070.07618.57
8.1.220.0160.06218.95
8.1.210.0100.07018.64
8.1.200.0100.08718.61
8.1.190.0070.07418.63
8.1.180.0170.08018.48
8.1.170.0130.08618.98
8.1.160.0070.06920.24
8.1.150.0100.08118.81
8.1.140.0100.08418.49
8.1.130.0030.07318.80
8.1.120.0170.07718.75
8.1.110.0030.07218.73
8.1.100.0100.08219.73
8.1.90.0030.07618.50
8.1.80.0200.09619.81
8.1.70.0130.08918.50
8.1.60.0130.08118.86
8.1.50.0070.07318.65
8.1.40.0130.08318.54
8.1.30.0070.08819.17
8.1.20.0000.07819.94
8.1.10.0070.07018.61
8.1.00.0100.07120.39
8.0.300.0130.08417.90
8.0.290.0160.07017.79
8.0.280.0220.06717.85
8.0.270.0100.06917.95
8.0.260.0290.08617.68
8.0.250.0210.06918.02
8.0.240.0190.07418.02
8.0.230.0130.07317.83
8.0.220.0190.06117.82
8.0.210.0140.08217.57
8.0.200.0290.08417.87
8.0.190.0300.08017.96
8.0.180.0130.07017.69
8.0.170.0260.07917.92
8.0.160.0130.06417.89
8.0.150.0260.06417.88
8.0.140.0170.07417.83
8.0.130.0170.07317.75
8.0.120.0220.06717.83
8.0.110.0130.07418.04
8.0.100.0200.08517.72
8.0.90.0100.08217.95
8.0.80.0260.06417.88
8.0.70.0170.08419.70
8.0.60.0230.06717.83
8.0.50.0140.07617.87
8.0.30.0070.06919.66
8.0.20.0100.09019.81
8.0.10.0230.06718.02
8.0.00.0070.08419.55
7.4.330.0170.07614.18
7.4.320.0240.06917.55
7.4.300.0280.06917.65
7.4.290.0230.09017.40
7.4.280.0240.07417.50
7.4.270.0280.06917.66
7.4.260.0100.07918.73
7.4.250.0270.06817.67
7.4.240.0240.08817.30
7.4.230.0360.07317.73
7.4.220.0200.07617.63
7.4.210.0300.08117.50
7.4.200.0340.08717.37
7.4.190.0190.07117.58
7.4.180.0240.08517.57
7.4.160.0230.07217.63
7.4.150.0240.09017.46
7.4.140.0200.07417.34
7.4.130.0220.07617.52
7.4.120.0250.06817.54
7.4.110.0300.08517.39
7.4.100.0270.06617.53
7.4.90.0250.08417.55
7.4.80.0170.07617.46
7.4.70.0270.09117.42
7.4.60.0300.08717.61
7.4.50.0210.07317.52
7.4.40.0340.07517.27
7.4.30.0140.10417.43
7.4.20.0310.08217.55
7.4.10.0280.09417.49
7.4.00.0270.08817.32
7.3.330.0270.09417.23
7.3.320.0330.08517.18
7.3.310.0170.08217.39
7.3.300.0140.08217.90
7.3.290.0270.09317.34
7.3.280.0240.09117.05
7.3.270.0140.08617.36
7.3.260.0230.08317.39
7.3.250.0300.07317.31
7.3.240.0300.09717.24
7.3.230.0200.08817.46
7.3.220.0200.09717.05
7.3.210.0270.08417.37
7.3.200.0230.07917.25
7.3.190.0200.07817.47
7.3.180.0250.07417.38
7.3.170.0290.09217.96
7.3.160.0340.08417.20
7.3.150.0290.07017.31
7.3.140.0210.09716.96
7.3.130.0170.08117.16
7.3.120.0340.08517.16
7.3.110.0270.08917.66
7.3.100.0280.06917.43
7.3.90.0180.07917.76
7.3.80.0240.07617.55
7.3.70.0170.09717.87
7.3.60.0240.07417.61
7.3.50.0240.07417.47
7.3.40.0310.07517.30
7.3.30.0320.08717.75
7.3.20.0250.08419.38
7.3.10.0410.08219.28
7.3.00.0100.09119.20
7.2.340.0140.09117.65
7.2.330.0160.08617.61
7.2.320.0290.08017.38
7.2.310.0290.09117.31
7.2.300.0210.09317.25
7.2.290.0200.09217.60
7.2.280.0200.08617.64
7.2.270.0240.08317.50
7.2.260.0290.09417.46
7.2.250.0200.08217.48
7.2.240.0210.10717.42
7.2.230.0350.09317.25
7.2.220.0250.10017.46
7.2.210.0260.08317.51
7.2.200.0390.08717.78
7.2.190.0210.08217.75
7.2.180.0150.10417.66
7.2.170.0210.11017.71
7.2.160.0210.07917.67
7.2.150.0260.07919.32
7.2.140.0240.08519.32
7.2.130.0230.09819.52
7.2.120.0200.08219.39
7.2.110.0210.10119.55
7.2.100.0030.08419.52
7.2.90.0230.08519.44
7.2.80.0210.08619.57
7.2.70.0340.08819.35
7.2.60.0300.09119.42
7.2.50.0200.10819.46
7.2.40.0240.08319.63
7.2.30.0320.08719.57
7.2.20.0230.07819.45
7.2.10.0180.09019.65
7.2.00.0140.07819.51
7.1.330.0220.09818.35
7.1.320.0160.12718.13
7.1.310.0140.11018.32
7.1.300.0190.10318.49
7.1.290.0330.11918.40
7.1.280.0180.13018.34
7.1.270.0170.11219.15
7.1.260.0300.11118.34
7.1.250.0230.11018.23
7.1.240.0170.10818.05
7.1.230.0220.10618.37
7.1.220.0200.11018.16
7.1.210.0200.11218.08
7.1.200.0230.11618.21
7.1.190.0260.10018.27
7.1.180.0140.10918.25
7.1.170.0100.11718.21
7.1.160.0200.11418.29
7.1.150.0190.10718.09
7.1.140.0370.10518.31
7.1.130.0230.10818.15
7.1.120.0210.12118.14
7.1.110.0300.11818.27
7.1.100.0200.11318.22
7.1.90.0260.11817.98
7.1.80.0170.10818.29
7.1.70.0200.12918.19
7.1.60.0230.12617.94
7.1.50.0240.12618.38
7.1.40.0140.13218.28
7.1.30.0190.10718.19
7.1.20.0200.10418.23
7.1.10.0300.11518.20
7.1.00.0160.10818.36
7.0.330.0200.10718.14
7.0.320.0330.11518.29
7.0.310.0340.11818.03
7.0.300.0230.10317.91
7.0.290.0160.10618.05
7.0.280.0270.11017.97
7.0.270.0370.12717.64
7.0.260.0240.10617.95
7.0.250.0240.11818.13
7.0.240.0140.11217.83
7.0.230.0170.11018.16
7.0.220.0240.11117.81
7.0.210.0170.10718.26
7.0.200.0230.10418.26
7.0.190.0260.11917.77
7.0.180.0140.11017.82
7.0.170.0270.11817.86
7.0.160.0250.10418.06
7.0.150.0230.10618.09
7.0.140.0170.12717.59
7.0.130.0230.11618.23
7.0.120.0100.11618.24
7.0.110.0140.10919.52
7.0.100.0240.12918.13
7.0.90.0130.10118.05
7.0.80.0100.11018.19
7.0.70.0130.12317.92
7.0.60.0100.11017.88
7.0.50.0160.11018.06
7.0.40.0340.12817.86
7.0.30.0100.11217.93
7.0.20.0170.12718.11
7.0.10.0260.10617.87
7.0.00.0200.10517.96
5.6.400.0300.38816.86
5.6.390.0230.36216.95
5.6.380.0170.39216.75
5.6.370.0200.42916.69
5.6.360.0200.37016.80
5.6.350.0230.35616.82
5.6.340.0300.35316.88
5.6.330.0260.37916.79
5.6.320.0270.38816.80
5.6.310.0130.37916.88
5.6.300.0260.38716.47
5.6.290.0170.37316.77
5.6.280.0300.37916.78
5.6.270.0200.37216.87
5.6.260.0170.37016.93
5.6.250.0200.38116.56
5.6.240.0230.36516.97
5.6.230.0170.38917.00
5.6.220.0230.36716.95
5.6.210.0200.36616.93
5.6.200.0130.36617.04
5.6.190.0330.36617.04
5.6.180.0230.38416.94
5.6.170.0300.37417.15
5.6.160.0330.37516.96
5.6.150.0230.37217.19
5.6.140.0230.35216.92
5.6.130.0100.39217.00
5.6.120.0100.37217.11
5.6.110.0200.38917.03
5.6.100.0230.38516.81
5.6.90.0200.36316.88
5.6.80.0240.39416.73
5.6.70.0200.37317.13
5.6.60.0260.40416.88
5.6.50.0300.38317.00
5.6.40.0300.34416.82
5.6.30.0130.36316.86
5.6.20.0230.38416.88
5.6.10.0230.39816.96
5.6.00.0270.39316.71
5.5.380.0230.37917.11
5.5.370.0130.38116.98
5.5.360.0330.38816.90
5.5.350.0170.39716.90
5.5.340.0230.37116.93
5.5.330.0200.36916.78
5.5.320.0200.38816.53
5.5.310.0170.37516.88
5.5.300.0200.39316.85
5.5.290.0230.37716.63
5.5.280.0230.41916.78
5.5.270.0260.36716.59
5.5.260.0300.38316.87
5.5.250.0230.36716.54
5.5.240.0230.39216.86
5.5.230.0170.36516.62
5.5.220.0260.38716.95
5.5.210.0230.39416.97
5.5.200.0200.38216.91
5.5.190.0240.38516.80
5.5.180.0200.37616.80
5.5.170.0230.36716.79
5.5.160.0230.38816.90
5.5.150.0200.38516.42
5.5.140.0170.37916.62
5.5.130.0330.43716.64
5.5.120.0260.47116.66
5.5.110.0170.43716.41
5.5.100.0230.39916.78
5.5.90.0170.39417.75
5.5.80.0170.37116.84
5.5.70.0170.39216.87
5.5.60.0200.37016.78
5.5.50.0270.37016.54
5.5.40.0230.36417.00
5.5.30.0200.39117.00
5.5.20.0200.39116.66
5.5.10.0230.38916.76
5.5.00.0230.39616.60
5.4.450.0170.40014.18
5.4.440.0100.37514.18
5.4.430.0100.37014.18
5.4.420.0170.38114.18
5.4.410.0270.37514.18
5.4.400.0170.38214.18
5.4.390.0130.36414.18
5.4.380.0100.37514.18
5.4.370.0140.39314.18
5.4.360.0230.38514.18
5.4.350.0100.38414.18
5.4.340.0130.37514.18
5.4.330.0130.38314.18
5.4.320.0170.37314.18
5.4.310.0200.37016.47
5.4.300.0230.36614.18
5.4.290.0100.36314.18
5.4.280.0070.37014.18
5.4.270.0200.37714.18
5.4.260.0100.40114.18
5.4.250.0200.38214.18
5.4.240.0130.39714.18
5.4.230.0170.39414.18
5.4.220.0200.36514.18
5.4.210.0100.36714.18
5.4.200.0200.35714.18
5.4.190.0160.35914.18
5.4.180.0230.37114.18
5.4.170.0200.36114.18
5.4.160.0230.43114.18
5.4.150.0130.46214.18
5.4.140.0200.41114.18
5.4.130.0100.39514.18
5.4.120.0130.36814.18
5.4.110.0200.38814.18
5.4.100.0260.36814.18
5.4.90.0170.37614.18
5.4.80.0130.37214.18
5.4.70.0170.36514.18
5.4.60.0130.38914.18
5.4.50.0300.37214.18
5.4.40.0170.35914.18
5.4.30.0130.36314.18
5.4.20.0200.36114.18
5.4.10.0260.35114.18
5.4.00.0170.39514.18
5.3.290.0100.46814.18
5.3.280.0100.49914.18
5.3.270.0130.50014.18
5.3.260.0170.48614.18
5.3.250.0170.46914.18
5.3.240.0130.50414.18
5.3.230.0200.51514.18
5.3.220.0100.46514.18
5.3.210.0170.45414.18
5.3.200.0200.45914.18
5.3.190.0130.45914.18
5.3.180.0200.44914.18
5.3.170.0230.45314.18
5.3.160.0170.47814.18
5.3.150.0170.46714.18
5.3.140.0230.43514.18
5.3.130.0260.47214.18
5.3.120.0170.45514.18
5.3.110.0230.45114.18
5.3.100.0200.45614.18
5.3.90.0170.45414.18
5.3.80.0170.45614.18
5.3.70.0170.45914.18
5.3.60.0130.47914.18
5.3.50.0200.48014.18
5.3.40.0130.45814.18
5.3.30.0140.49614.18
5.3.20.0200.46514.18
5.3.10.0200.47814.18
5.3.00.0170.44714.18
5.2.170.0130.49814.18
5.2.160.0100.50914.18
5.2.150.0170.51914.18
5.2.140.0100.52414.18
5.2.130.0200.50014.18
5.2.120.0070.52614.18
5.2.110.0130.52914.18
5.2.100.0200.48614.18
5.2.90.0170.53014.18
5.2.80.0130.52014.18
5.2.70.0140.51814.18
5.2.60.0200.50714.18
5.2.50.0070.56414.18
5.2.40.0230.51714.18
5.2.30.0100.51814.18
5.2.20.0100.52514.18
5.2.10.0130.51314.18
5.2.00.0170.55614.18
5.1.60.0230.51914.18
5.1.50.0130.58314.18
5.1.40.0200.56714.18
5.1.30.0100.50514.18
5.1.20.0100.48714.18
5.1.10.0130.50914.18
5.1.00.0130.47714.18
5.0.50.0130.96114.18
5.0.40.0100.97014.18
5.0.30.0070.93614.18
5.0.20.0070.89614.18
5.0.10.0130.91914.18
5.0.00.0100.89014.18
4.4.90.0100.77714.18
4.4.80.0130.80314.18
4.4.70.0000.79914.18
4.4.60.0100.80114.18
4.4.50.0000.80414.18
4.4.40.0100.79314.18
4.4.30.0100.83714.18
4.4.20.0030.87214.18
4.4.10.0100.91814.18
4.4.00.0100.86814.18
4.3.110.0100.86514.18
4.3.100.0070.80814.18
4.3.90.0000.78914.18
4.3.80.0100.79614.18
4.3.70.0070.80114.18
4.3.60.0070.82914.18
4.3.50.0100.81614.18
4.3.40.0000.79814.18
4.3.30.0070.82214.18
4.3.20.0070.88714.18
4.3.10.0100.78414.18
4.3.00.0030.79114.18

preferences:
37.73 ms | 403 KiB | 5 Q