Closed TimothyBJacobs closed 3 years ago
The following test causes a fatal error when running against PHP 8.
When I run `wp search-replace foo bar --all-tables` # vendor/wp-cli/wp-cli-tests/features/steps/when.php:29 $ wp search-replace foo bar --all-tables PHP Fatal error: Uncaught TypeError: unserialize(): Argument #1 ($data) must be of type string, array given in /private/var/folders/7d/mcmynw4x60v3y8nwlfz3ppg80000gn/T/wp-cli-home/.wp-cli/packages/vendor/wp-cli/search-replace-command/src/WP_CLI/SearchReplacer.php:86 Stack trace: #0 /private/var/folders/7d/mcmynw4x60v3y8nwlfz3ppg80000gn/T/wp-cli-home/.wp-cli/packages/vendor/wp-cli/search-replace-command/src/WP_CLI/SearchReplacer.php(86): unserialize(Array) #1 /private/var/folders/7d/mcmynw4x60v3y8nwlfz3ppg80000gn/T/wp-cli-home/.wp-cli/packages/vendor/wp-cli/search-replace-command/src/WP_CLI/SearchReplacer.php(88): WP_CLI\SearchReplacer->run_recursively(Array, true, 1) #2 /private/var/folders/7d/mcmynw4x60v3y8nwlfz3ppg80000gn/T/wp-cli-home/.wp-cli/packages/vendor/wp-cli/search-replace-command/src/WP_CLI/SearchReplacer.php(57): WP_CLI\SearchReplacer->run_recursively('a:1:{i:0;s:3:"f...', false) #3 /private/var/folders/7d/mcmynw4x60v3y8nwlfz3ppg80000gn/T/wp-cli-home/.wp-cli/packages/vendor/wp-cli/search-replace-command/src/Search_Replace_Command.php(556): WP_CLI\SearchReplacer->run('a:1:{i:0;s:3:"f...') #4 /private/var/folders/7d/mcmynw4x60v3y8nwlfz3ppg80000gn/T/wp-cli-home/.wp-cli/packages/vendor/wp-cli/search-replace-command/src/Search_Replace_Command.php(392): Search_Replace_Command->php_handle_col('option_value', Array, 'wp_options', 'foo', 'bar') #5 [internal function]: Search_Replace_Command->__invoke(Array, Array) #6 php/WP_CLI/Dispatcher/CommandFactory.php(98): call_user_func(Array, Array, Array) #7 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}(Array, Array) #8 php/WP_CLI/Dispatcher/Subcommand.php(489): call_user_func(Object(Closure), Array, Array) #9 php/WP_CLI/Runner.php(380): WP_CLI\Dispatcher\Subcommand->invoke(Array, Array, Array) #10 php/WP_CLI/Runner.php(1478): WP_CLI\Runner->run_command(Array, Array) #11 /private/var/folders/7d/mcmynw4x60v3y8nwlfz3ppg80000gn/T/wp-cli-test-run-bootstrap.feature.358-5fa4a6f6dffad7.54592084/wp-includes/class-wp-hook.php(289): WP_CLI\Runner::WP_CLI\{closure}(Object(stdClass)) #12 /private/var/folders/7d/mcmynw4x60v3y8nwlfz3ppg80000gn/T/wp-cli-test-run-bootstrap.feature.358-5fa4a6f6dffad7.54592084/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters('', Array) #13 /private/var/folders/7d/mcmynw4x60v3y8nwlfz3ppg80000gn/T/wp-cli-test-run-bootstrap.feature.358-5fa4a6f6dffad7.54592084/wp-includes/plugin.php(478): WP_Hook->do_action(Array) #14 /private/var/folders/7d/mcmynw4x60v3y8nwlfz3ppg80000gn/T/wp-cli-test-run-bootstrap.feature.358-5fa4a6f6dffad7.54592084/wp-includes/ms-load.php(416): do_action('ms_site_not_fou...', Object(stdClass), 'invalid.com', '') #15 /private/var/folders/7d/mcmynw4x60v3y8nwlfz3ppg80000gn/T/wp-cli-test-run-bootstrap.feature.358-5fa4a6f6dffad7.54592084/wp-includes/ms-settings.php(72): ms_load_current_site_and_network('invalid.com', '', false) #16 /private/var/folders/7d/mcmynw4x60v3y8nwlfz3ppg80000gn/T/wp-cli-test-run-bootstrap.feature.358-5fa4a6f6dffad7.54592084/wp-settings.php(141): require('/private/var/fo...') #17 php/WP_CLI/Runner.php(1251): require('/private/var/fo...') #18 php/WP_CLI/Runner.php(1172): WP_CLI\Runner->load_wordpress() #19 php/WP_CLI/Bootstrap/LaunchRunner.php(23): WP_CLI\Runner->start() #20 php/bootstrap.php(75): WP_CLI\Bootstrap\LaunchRunner->process(Object(WP_CLI\Bootstrap\BootstrapState)) #21 php/wp-cli.php(27): WP_CLI\bootstrap() #22 php/boot-fs.php(17): require_once('/Users/timothyb...') #23 {main} thrown in /private/var/folders/7d/mcmynw4x60v3y8nwlfz3ppg80000gn/T/wp-cli-home/.wp-cli/packages/vendor/wp-cli/search-replace-command/src/WP_CLI/SearchReplacer.php on line 86
Looks like this was introduced in babbfbfcc1d36aff2f8b54f7b491bded98bde5d3.
The following test causes a fatal error when running against PHP 8.