3v4l.org

run code in 300+ PHP versions simultaneously
<?php define( 'TESTDOX', true ); function wp_is_development_mode( $mode = null ) { $current_mode = wp_get_development_mode(); if ( empty( $current_mode ) ) { return '' === $mode; } // Return true if the current mode encompasses all modes. if ( 'all' === $current_mode ) { return true; } // Return true if the current mode is the given mode. return $mode === $current_mode; } // Polyfill. global $test_development_mode; function wp_get_development_mode() { global $test_development_mode; return $test_development_mode; } // Test cases. $dataset = array( 'both are empty strings' => array( 'mode' => '', 'dev' => '', 'expected' => true, ), 'both are non-empty, matching strings' => array( 'mode' => 'plugin', 'dev' => 'plugin', 'expected' => true, ), 'both are non-empty, unmatching strings' => array( 'mode' => 'core', 'dev' => 'theme', 'expected' => false, ), '$mode is null and development mode is an empty string' => array( 'mode' => null, 'dev' => '', 'expected' => false, ), '$mode is an empty string, development mode is a non-empty string' => array( 'mode' => '', 'dev' => 'core', 'expected' => false, ), '$mode is a non-empty string, development mode is an empty string' => array( 'mode' => 'core', 'dev' => '', 'expected' => false, ), ); foreach ( $dataset as $name => $data ) { $test_development_mode = $data['dev']; $actual = null === $data['mode'] ? wp_is_development_mode() : wp_is_development_mode( $data['mode'] ); $result = $actual === $data['expected'] ? '.' : 'F'; if ( defined( 'TESTDOX' ) && TESTDOX ) { echo '.' === $result ? 'PASS' : 'FAIL', ': ', $name, ' (', var_export( $data['expected'], true ), ')', PHP_EOL; } else { echo $result; } }

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.110.0060.00320.94
8.3.100.0100.00620.14
8.3.90.0050.00319.93
8.3.80.0080.00416.38
8.3.70.0180.00416.58
8.3.60.0180.00320.34
8.3.50.0070.01116.59
8.3.40.0110.00322.00
8.3.30.0180.00020.05
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0040.00426.16
8.2.230.0090.00622.58
8.2.220.0070.00324.06
8.2.210.0140.00326.77
8.2.200.0030.00616.50
8.2.190.0110.01118.54
8.2.180.0100.01016.32
8.2.170.0040.01118.96
8.2.160.0080.00622.96
8.2.150.0000.00725.66
8.2.140.0050.00324.66
8.2.130.0000.00826.16
8.2.120.0070.00021.00
8.2.110.0060.00322.11
8.2.100.0100.00317.91
8.2.90.0000.00818.03
8.2.80.0000.00819.11
8.2.70.0120.00679.33
8.2.60.0120.00679.33
8.2.50.0070.01179.33
8.2.40.0090.00979.33
8.2.30.0130.00479.33
8.2.20.0150.00379.33
8.2.10.0130.00379.33
8.2.00.0090.00079.33
8.1.290.0060.00330.84
8.1.280.0110.00425.92
8.1.270.0040.00424.66
8.1.260.0050.00326.35
8.1.250.0080.00028.09
8.1.240.0090.00022.50
8.1.230.0040.00720.99
8.1.220.0030.00717.74
8.1.210.0080.00018.77
8.1.200.0110.00679.33
8.1.190.0180.00079.33
8.1.180.0130.00579.33
8.1.170.0110.00779.33
8.1.160.0080.00879.33
8.1.150.0170.00079.33
8.1.140.0120.00679.33
8.1.130.0120.00579.33
8.1.120.0160.00879.33
8.1.110.0120.00579.33
8.1.100.0120.00879.33
8.1.90.0140.00379.33
8.1.80.0120.00679.33
8.1.70.0170.00079.33
8.1.60.0130.00779.33
8.1.50.0130.00679.33
8.1.40.0120.00679.33
8.1.30.0180.00079.33
8.1.20.0190.00079.33
8.1.10.0160.00379.33
8.1.00.0160.00379.33
8.0.300.0070.00020.13
8.0.290.0110.00679.33
8.0.280.0170.00079.33
8.0.270.0120.00579.33
8.0.260.0170.00079.33
8.0.250.0080.00879.33
8.0.240.0160.00079.33
8.0.230.0090.00979.33
8.0.220.0120.00479.33
8.0.210.0130.00679.33
8.0.200.0160.00079.33
8.0.190.0170.00079.33
8.0.180.0060.01079.33
8.0.170.0100.00579.33
8.0.160.0090.00679.33
8.0.150.0080.00879.33
8.0.140.0120.00679.33
8.0.130.0130.00479.33
8.0.120.0150.00479.33
8.0.110.0090.00779.33
8.0.100.0140.00579.33
8.0.90.0110.00879.33
8.0.80.0120.00679.33
8.0.70.0130.00379.33
8.0.60.0100.00779.33
8.0.50.0120.00479.33
8.0.30.0150.00379.33
8.0.20.0080.00879.33
8.0.10.0070.01079.33

preferences:
41.72 ms | 403 KiB | 5 Q