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' ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oeFUJ
function name:  (null)
number of ops:  37
compiled vars:  !0 = $new_allowed_options
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ECHO                                                     'Scenario+1%3A+%0A'
   17     1        ASSIGN                                                   !0, null
   18     2        INIT_FCALL                                               'var_dump'
          3        INIT_FCALL                                               'unregister_setting'
          4        SEND_VAL                                                 'unknown_setting_group'
          5        SEND_VAL                                                 'unknown_setting_name'
          6        DO_FCALL                                      0  $2      
          7        SEND_VAR                                                 $2
          8        DO_ICALL                                                 
   21     9        ECHO                                                     '%0AScenario+2%3A+%0A'
   22    10        ASSIGN                                                   !0, <array>
   23    11        INIT_FCALL                                               'var_dump'
         12        INIT_FCALL                                               'unregister_setting'
         13        SEND_VAL                                                 'unknown_setting_group'
         14        SEND_VAL                                                 'unknown_setting_name'
         15        DO_FCALL                                      0  $5      
         16        SEND_VAR                                                 $5
         17        DO_ICALL                                                 
   26    18        ECHO                                                     '%0AScenario+3%3A+%0A'
   27    19        ASSIGN                                                   !0, <array>
   28    20        INIT_FCALL                                               'var_dump'
         21        INIT_FCALL                                               'unregister_setting'
         22        SEND_VAL                                                 'unknown_setting_group'
         23        SEND_VAL                                                 'unknown_setting_name'
         24        DO_FCALL                                      0  $8      
         25        SEND_VAR                                                 $8
         26        DO_ICALL                                                 
   31    27        ECHO                                                     '%0AScenario+4%3A+%0A'
   32    28        ASSIGN                                                   !0, <array>
   33    29        INIT_FCALL                                               'var_dump'
         30        INIT_FCALL                                               'unregister_setting'
         31        SEND_VAL                                                 'unknown_setting_group'
         32        SEND_VAL                                                 'unknown_setting_name'
         33        DO_FCALL                                      0  $11     
         34        SEND_VAR                                                 $11
         35        DO_ICALL                                                 
         36      > RETURN                                                   1

Function unregister_setting:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oeFUJ
function name:  unregister_setting
number of ops:  14
compiled vars:  !0 = $option_group, !1 = $option_name, !2 = $deprecated, !3 = $new_allowed_options, !4 = $pos
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      ''
    4     3        BIND_GLOBAL                                              !3, 'new_allowed_options'
    7     4        INIT_FCALL                                               'array_search'
          5        SEND_VAR                                                 !1
          6        FETCH_DIM_R                                      ~5      !3, !0
          7        CAST                                          7  ~6      ~5
          8        SEND_VAL                                                 ~6
          9        SEND_VAL                                                 <true>
         10        DO_ICALL                                         $7      
         11        ASSIGN                                                   !4, $7
   12    12      > RETURN                                                   !4
   13    13*     > RETURN                                                   null

End of function unregister_setting

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153 ms | 1467 KiB | 19 Q