3v4l.org

run code in 300+ PHP versions simultaneously
<?php add_action('widgets_init', 'my_widget_plugin_td_load'); function my_widget_plugin_td_load() { register_widget('my_widget_plugin_td'); } class my_widget_plugin_td extends WP_Widget { function __construct() { parent::__construct( 'my-widget-plugin-vdj', 'Время и Дата', array('description' => 'Время и дата на Java',) ); } /** * Настройка виджета. В данном случае заголовок. * @param array $instance * @return string|void */ public function form($instance) { if (isset($instance['title'])) { $title = $instance['title']; } else { $title = 'Здесь можно указать заголовок виджета'; } ?> <p> <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>"/> </p> <?php } /** * Вывод виджета * @param array $args * @param array $instance */ public function widget($args, $instance) { // $title = apply_filters('widget_title', $instance['title']); $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); echo $args['before_widget']; if (!empty($title)) echo $args['before_title'] . $title . $args['after_title']; // здесь выводим содержимое (форму) echo <<<HTML <div class="cleanslate w24tz-current-time w24tz-small" style="display: inline-block !important; visibility: hidden !important; min-width:100px !important; width:100% !important; min-height:100px !important; text-align:center !important;"><p><a href="//24timezones.com/world_directory/time_in_moscow.php" style="text-decoration: none" class="clock24" id="tz24-1539074187-c1166-eyJob3VydHlwZSI6IjI0Iiwic2hvd2RhdGUiOiIxIiwic2hvd3NlY29uZHMiOiIxIiwiY29udGFpbmVyX2lkIjoiY2xvY2tfYmxvY2tfY2I1YmJjNjg4YmJjZjE1IiwidHlwZSI6ImRiIiwibGFuZyI6InJ1In0=" title="часовой пояс Moscow" target="_blank" rel="nofollow">Текущее время</a></p> <div id="clock_block_cb5bbc688bbcf15"></div> </div> <script type="text/javascript" src="//w.24timezones.com/l.js" async></script> HTML; // конец формы echo $args['after_widget']; } public function update($new_instance, $old_instance) { $instance = array(); $instance['title'] = (!empty($new_instance['title'])) ? strip_tags($new_instance['title']) : ''; return $instance; } } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VDOCK
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL_BY_NAME                                       'add_action'
          1        SEND_VAL_EX                                              'widgets_init'
          2        SEND_VAL_EX                                              'my_widget_plugin_td_load'
          3        DO_FCALL                                      0          
    9     4        DECLARE_CLASS                                            'my_widget_plugin_td', 'wp_widget'
   78     5      > RETURN                                                   1

Function my_widget_plugin_td_load:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VDOCK
function name:  my_widget_plugin_td_load
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL_BY_NAME                                       'register_widget'
          1        SEND_VAL_EX                                              'my_widget_plugin_td'
          2        DO_FCALL                                      0          
    7     3      > RETURN                                                   null

End of function my_widget_plugin_td_load

Class my_widget_plugin_td:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VDOCK
function name:  __construct
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_STATIC_METHOD_CALL                                  
   14     1        SEND_VAL_EX                                              'my-widget-plugin-vdj'
   15     2        SEND_VAL_EX                                              '%D0%92%D1%80%D0%B5%D0%BC%D1%8F+%D0%B8+%D0%94%D0%B0%D1%82%D0%B0'
   16     3        SEND_VAL_EX                                              <array>
          4        DO_FCALL                                      0          
   18     5      > RETURN                                                   null

End of function __construct

Function form:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VDOCK
function name:  form
number of ops:  33
compiled vars:  !0 = $instance, !1 = $title
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
   27     1        ISSET_ISEMPTY_DIM_OBJ                         0          !0, 'title'
          2      > JMPZ                                                     ~2, ->6
   28     3    >   FETCH_DIM_R                                      ~3      !0, 'title'
          4        ASSIGN                                                   !1, ~3
          5      > JMP                                                      ->7
   30     6    >   ASSIGN                                                   !1, '%D0%97%D0%B4%D0%B5%D1%81%D1%8C+%D0%BC%D0%BE%D0%B6%D0%BD%D0%BE+%D1%83%D0%BA%D0%B0%D0%B7%D0%B0%D1%82%D1%8C+%D0%B7%D0%B0%D0%B3%D0%BE%D0%BB%D0%BE%D0%B2%D0%BE%D0%BA+%D0%B2%D0%B8%D0%B4%D0%B6%D0%B5%D1%82%D0%B0'
   33     7    >   ECHO                                                     '++++++++%3Cp%3E%0A++++++++++++%3Clabel+for%3D%22'
   34     8        INIT_METHOD_CALL                                         'get_field_id'
          9        SEND_VAL_EX                                              'title'
         10        DO_FCALL                                      0  $6      
         11        ECHO                                                     $6
         12        ECHO                                                     '%22%3E'
         13        INIT_FCALL_BY_NAME                                       '_e'
         14        SEND_VAL_EX                                              'Title%3A'
         15        DO_FCALL                                      0          
         16        ECHO                                                     '%3C%2Flabel%3E%0A++++++++++++%3Cinput+class%3D%22widefat%22+id%3D%22'
   35    17        INIT_METHOD_CALL                                         'get_field_id'
         18        SEND_VAL_EX                                              'title'
         19        DO_FCALL                                      0  $8      
         20        ECHO                                                     $8
         21        ECHO                                                     '%22%0A+++++++++++++++++++name%3D%22'
   36    22        INIT_METHOD_CALL                                         'get_field_name'
         23        SEND_VAL_EX                                              'title'
         24        DO_FCALL                                      0  $9      
         25        ECHO                                                     $9
         26        ECHO                                                     '%22+type%3D%22text%22%0A+++++++++++++++++++value%3D%22'
   37    27        INIT_FCALL_BY_NAME                                       'esc_attr'
         28        SEND_VAR_EX                                              !1
         29        DO_FCALL                                      0  $10     
         30        ECHO                                                     $10
         31        ECHO                                                     '%22%2F%3E%0A++++++++%3C%2Fp%3E%0A++++++++'
   40    32      > RETURN                                                   null

End of function form

Function widget:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 29
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 29
Branch analysis from position: 24
Branch analysis from position: 29
filename:       /in/VDOCK
function name:  widget
number of ops:  33
compiled vars:  !0 = $args, !1 = $instance, !2 = $title
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   47     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   51     2        ISSET_ISEMPTY_DIM_OBJ                         1  ~3      !1, 'title'
          3        BOOL_NOT                                         ~4      ~3
          4      > JMPZ                                                     ~4, ->8
          5    >   FETCH_DIM_R                                      ~5      !1, 'title'
          6        QM_ASSIGN                                        ~6      ~5
          7      > JMP                                                      ->9
          8    >   QM_ASSIGN                                        ~6      ''
          9    >   ASSIGN                                                   !2, ~6
   52    10        INIT_FCALL_BY_NAME                                       'apply_filters'
         11        SEND_VAL_EX                                              'widget_title'
         12        SEND_VAR_EX                                              !2
         13        SEND_VAR_EX                                              !1
         14        CHECK_FUNC_ARG                                           
         15        FETCH_OBJ_FUNC_ARG                               $8      'id_base'
         16        SEND_FUNC_ARG                                            $8
         17        DO_FCALL                                      0  $9      
         18        ASSIGN                                                   !2, $9
   54    19        FETCH_DIM_R                                      ~11     !0, 'before_widget'
         20        ECHO                                                     ~11
   55    21        ISSET_ISEMPTY_CV                                 ~12     !2
         22        BOOL_NOT                                         ~13     ~12
         23      > JMPZ                                                     ~13, ->29
   56    24    >   FETCH_DIM_R                                      ~14     !0, 'before_title'
         25        CONCAT                                           ~15     ~14, !2
         26        FETCH_DIM_R                                      ~16     !0, 'after_title'
         27        CONCAT                                           ~17     ~15, ~16
         28        ECHO                                                     ~17
   60    29    >   ECHO                                                     '%3Cdiv+class%3D%22cleanslate+w24tz-current-time+w24tz-small%22+style%3D%22display%3A+inline-block+%21important%3B+visibility%3A+hidden+%21important%3B+min-width%3A100px+%21important%3B+width%3A100%25+%21important%3B+min-height%3A100px+%21important%3B+text-align%3Acenter+%21important%3B%22%3E%3Cp%3E%3Ca+href%3D%22%2F%2F24timezones.com%2Fworld_directory%2Ftime_in_moscow.php%22+style%3D%22text-decoration%3A+none%22+class%3D%22clock24%22+id%3D%22tz24-1539074187-c1166-eyJob3VydHlwZSI6IjI0Iiwic2hvd2RhdGUiOiIxIiwic2hvd3NlY29uZHMiOiIxIiwiY29udGFpbmVyX2lkIjoiY2xvY2tfYmxvY2tfY2I1YmJjNjg4YmJjZjE1IiwidHlwZSI6ImRiIiwibGFuZyI6InJ1In0%3D%22+title%3D%22%D1%87%D0%B0%D1%81%D0%BE%D0%B2%D0%BE%D0%B9+%D0%BF%D0%BE%D1%8F%D1%81+Moscow%22+target%3D%22_blank%22+rel%3D%22nofollow%22%3E%D0%A2%D0%B5%D0%BA%D1%83%D1%89%D0%B5%D0%B5+%D0%B2%D1%80%D0%B5%D0%BC%D1%8F%3C%2Fa%3E%3C%2Fp%3E%0A%09%09%3Cdiv+id%3D%22clock_block_cb5bbc688bbcf15%22%3E%3C%2Fdiv%3E%0A%09%09%3C%2Fdiv%3E%0A%09%09%0A%09%09%3Cscript+type%3D%22text%2Fjavascript%22+src%3D%22%2F%2Fw.24timezones.com%2Fl.js%22+async%3E%3C%2Fscript%3E'
   68    30        FETCH_DIM_R                                      ~18     !0, 'after_widget'
         31        ECHO                                                     ~18
   69    32      > RETURN                                                   null

End of function widget

Function update:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 12
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VDOCK
function name:  update
number of ops:  17
compiled vars:  !0 = $new_instance, !1 = $old_instance, !2 = $instance
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   71     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   73     2        ASSIGN                                                   !2, <array>
   74     3        ISSET_ISEMPTY_DIM_OBJ                         1  ~5      !0, 'title'
          4        BOOL_NOT                                         ~6      ~5
          5      > JMPZ                                                     ~6, ->12
          6    >   INIT_FCALL                                               'strip_tags'
          7        FETCH_DIM_R                                      ~7      !0, 'title'
          8        SEND_VAL                                                 ~7
          9        DO_ICALL                                         $8      
         10        QM_ASSIGN                                        ~9      $8
         11      > JMP                                                      ->13
         12    >   QM_ASSIGN                                        ~9      ''
         13    >   ASSIGN_DIM                                               !2, 'title'
         14        OP_DATA                                                  ~9
   75    15      > RETURN                                                   !2
   76    16*     > RETURN                                                   null

End of function update

End of class my_widget_plugin_td.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
208.65 ms | 1408 KiB | 15 Q