3v4l.org

run code in 300+ PHP versions simultaneously
<?php global $wp_test_hooks; if(!is_array($wp_test_hooks)) { $wp_test_hooks = []; } if(!function_exists('add_filter')) { function add_filter( $hook_name, $callback, $priority = 10, $accepted_args = 1 ) { global $wp_test_hooks; $wp_test_hooks[$hook_name][] = [ $callback, $priority, $accepted_args, ]; return true; } } if(!function_exists('add_action')) { function add_action( $hook_name, $callback, $priority = 10, $accepted_args = 1 ) { return add_filter( $hook_name, $callback, $priority, $accepted_args ); } } if(!function_exists('apply_filters')){ function apply_filters( $hook_name, ...$values ) { $value = array_shift($values); global $wp_test_hooks; if(array_key_exists($hook_name, $wp_test_hooks)){ foreach($wp_test_hooks[$hook_name] as $parts){ list($callback, $priority, $accepted_args) = $parts; $value = $callback($value, ...$values); } } return $value; } } if(!function_exists('do_action')){ function do_action( $hook_name, ...$arg ) { global $wp_test_hooks; if(array_key_exists($hook_name, $wp_test_hooks)){ foreach($wp_test_hooks[$hook_name] as $parts){ list($callback, $priority, $accepted_args) = $parts; $callback(...$arg); } } } } add_action('name1', static function(){echo 'In the Action';}); add_filter('name2', static function($originalValue){return 'In the Filter';}); do_action('name1', 'test', 'stuff'); echo PHP_EOL; echo apply_filters('name2', 'test', 'stuff');

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.4.140.0130.00917.45
8.4.130.0120.00817.72
8.4.120.0110.00820.30
8.4.110.0130.00818.85
8.4.100.0040.00517.92
8.4.90.0130.00817.83
8.4.80.0090.00817.79
8.4.70.0060.01018.24
8.4.60.0060.00518.75
8.4.50.0100.01018.91
8.4.40.0090.00917.92
8.4.30.0090.00020.51
8.4.20.0110.00017.52
8.4.10.0090.00022.04
8.3.270.0140.00616.67
8.3.260.0070.01116.67
8.3.250.0080.01118.92
8.3.240.0110.00916.65
8.3.230.0100.00916.62
8.3.220.0020.00616.56
8.3.210.0100.00818.66
8.3.200.0040.00516.70
8.3.190.0090.01017.01
8.3.180.0090.01017.27
8.3.170.0090.00918.74
8.3.160.0040.01117.24
8.3.150.0170.00317.41
8.3.140.0080.00016.48
8.3.130.0040.00418.50
8.3.120.0040.00420.81
8.3.110.0100.01016.50
8.3.100.0030.00616.91
8.3.90.0150.00426.77
8.3.80.0030.00616.75
8.3.70.0060.01016.75
8.3.60.0100.00618.68
8.3.50.0070.00720.35
8.3.40.0040.01120.96
8.3.30.0150.00619.15
8.3.20.0040.00424.18
8.3.10.0000.00824.66
8.3.00.0050.00326.16
8.2.290.0130.00518.89
8.2.280.0060.01218.70
8.2.270.0160.00317.30
8.2.260.0050.00316.59
8.2.250.0040.00418.67
8.2.240.0060.00317.05
8.2.230.0070.00320.94
8.2.220.0090.01237.54
8.2.210.0070.00326.77
8.2.200.0040.00416.50
8.2.190.0120.00618.41
8.2.180.0070.00725.92
8.2.170.0070.00719.09
8.2.160.0070.01122.96
8.2.150.0080.00025.66
8.2.140.0040.00424.66
8.2.130.0060.00326.16
8.2.120.0040.00421.13
8.2.110.0060.00322.14
8.2.100.0080.00819.58
8.2.90.0040.00417.88
8.2.80.0000.00918.74
8.2.70.0080.00017.75
8.2.60.0000.00818.03
8.2.50.0050.00318.07
8.2.40.0080.00018.34
8.2.30.0000.00818.04
8.2.20.0040.00420.36
8.2.10.0040.00418.04
8.2.00.0040.00419.39
8.1.330.0100.00816.00
8.1.320.0100.00915.94
8.1.310.0090.00917.00
8.1.300.0150.00420.01
8.1.290.0000.00930.84
8.1.280.0150.00825.92
8.1.270.0080.00023.99
8.1.260.0050.00326.35
8.1.250.0080.00028.09
8.1.240.0070.00320.74
8.1.230.0120.00017.95
8.1.220.0060.00317.74
8.1.210.0030.00618.77
8.1.200.0060.00317.35
8.1.190.0070.00317.35
8.1.180.0040.00418.10
8.1.170.0030.00618.40
8.1.160.0040.00418.98
8.1.150.0000.00718.67
8.1.140.0000.00717.52
8.1.130.0000.00718.86
8.1.120.0050.00217.54
8.1.110.0070.00017.49
8.1.100.0040.00417.39
8.1.90.0000.00717.39
8.1.80.0000.00817.43
8.1.70.0000.00717.46
8.1.60.0170.00217.52
8.1.50.0140.00517.40
8.1.40.0080.00817.54
8.1.30.0090.00517.52
8.1.20.0060.01317.62
8.1.10.0210.00017.59
8.1.00.0140.00617.38
8.0.300.0020.00518.77
8.0.290.0000.00816.75
8.0.280.0030.00320.15
8.0.270.0050.00317.96
8.0.260.0000.00718.49
8.0.250.0030.00316.98
8.0.240.0080.00016.93
8.0.230.0030.00316.91
8.0.220.0070.00016.95
8.0.210.0000.00716.92
8.0.200.0000.00716.91
8.0.190.0120.00417.00
8.0.180.0150.00016.87
8.0.170.0140.00316.93
8.0.160.0120.00616.89
8.0.150.0120.00416.85
8.0.140.0110.00316.75
8.0.130.0030.00916.87
8.0.120.0080.00516.86
8.0.110.0130.00416.77
8.0.100.0120.00516.92
8.0.90.0080.00816.95
8.0.80.0100.00516.85
8.0.70.0150.00016.94
8.0.60.0130.00016.88
8.0.50.0120.00516.86
8.0.30.0030.00916.91
8.0.20.0090.00216.70
8.0.10.0070.00516.72
7.4.330.0000.00515.55
7.4.320.0060.00016.49
7.4.300.0030.00316.68
7.4.290.0080.00316.44
7.4.280.0130.00516.64
7.4.270.0170.00016.55
7.4.260.0140.00316.55
7.4.250.0170.00016.66
7.4.240.0110.00816.62
7.4.230.0130.00316.63
7.4.220.0130.00316.54
7.4.210.0140.00316.58
7.4.200.0120.00416.45
7.4.190.0060.01016.59
7.4.180.0110.00316.68
7.4.160.0110.00416.58
7.4.150.0100.00516.54
7.4.140.0120.00316.49
7.4.130.0050.01116.38
7.4.120.0100.00316.32
7.4.110.0120.00316.48
7.4.100.0070.00716.53
7.4.90.0000.01316.52
7.4.80.0110.00016.44
7.4.70.0030.01116.50
7.4.60.0080.00616.46
7.4.50.0110.00416.43
7.4.40.0130.00316.43
7.4.30.0120.00316.48
7.4.20.0080.00516.34
7.4.10.0000.01616.52
7.4.00.0110.00516.47

preferences:
31.29 ms | 403 KiB | 5 Q