3v4l.org

run code in 300+ PHP versions simultaneously
<?php function unregister_setting( $option_group, $option_name, $deprecated = '' ) { global $new_allowed_options; // Before. $pos = array_search( $option_name, (array) $new_allowed_options[ $option_group ], true ); // After. return $pos; } // Scenario 1: Raises "Warning: Trying to access array offset on value of type null" echo "Scenario 1: \n"; $new_allowed_options = null; var_dump( unregister_setting( 'unknown_setting_group', 'unknown_setting_name' ) ); // Scenario 2: Raises "Warning: Undefined array key "unknown_setting_group" " echo "\nScenario 2: \n"; $new_allowed_options = array(); var_dump( unregister_setting( 'unknown_setting_group', 'unknown_setting_name' ) ); // Scenario 3: Does not riase a Notice|Warning. echo "\nScenario 3: \n"; $new_allowed_options = array( 'unknown_setting_group' => array() ); var_dump( unregister_setting( 'unknown_setting_group', 'unknown_setting_name' ) ); // Scenario 4: Does not riase a Notice|Warning. echo "\nScenario 4: \n"; $new_allowed_options = array( 'unknown_setting_group' => null ); var_dump( unregister_setting( 'unknown_setting_group', 'unknown_setting_name' ) );
Output for git.master, git.master_jit, rfc.property-hooks
Scenario 1: Warning: Trying to access array offset on null in /in/oeFUJ on line 7 bool(false) Scenario 2: Warning: Undefined array key "unknown_setting_group" in /in/oeFUJ on line 7 bool(false) Scenario 3: bool(false) Scenario 4: bool(false)

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
27.6 ms | 405 KiB | 5 Q