3v4l.org

run code in 300+ PHP versions simultaneously
<?php class WP_REST_Global_Styles_Controller { public function update_item() { echo "\n" . __METHOD__ . "\n"; $this->prepare_item_for_database(); } protected function prepare_item_for_database() { echo "\n" . __METHOD__ . "\n"; $this->validate_custom_css(); } private function validate_custom_css() { echo __METHOD__ . "()\n"; } } class Gutenberg_REST_Global_Styles_Controller extends WP_REST_Global_Styles_Controller { protected function prepare_item_for_database() { echo "\n" . __METHOD__ . "\n"; $this->validate_custom_css(); } /** * Copy of the parent's method. * The parent's method is private, meaning a child cannot overload or invoke it. * But a child class can have a method with the same name and different visibility. */ protected function validate_custom_css() { echo __METHOD__ . "()\n"; } } class Gutenberg_REST_Global_Styles_Controller_X_X extends Gutenberg_REST_Global_Styles_Controller {} class WP_REST_Global_Styles_Controller_X_X extends WP_REST_Global_Styles_Controller { // will cause a fatal error. protected function prepare_item_for_database() { // overloads the parent's method. echo "\n" . __METHOD__ . "\n"; $this->validate_custom_css(); // will cause a fatal error, as the parent's method is private to it. } } ( new Gutenberg_REST_Global_Styles_Controller() )->update_item(); ( new Gutenberg_REST_Global_Styles_Controller_X_X() )->update_item(); ( new WP_REST_Global_Styles_Controller_X_X() )->update_item();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J5u29
function name:  (null)
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   45     0  E >   NEW                                              $0      'Gutenberg_REST_Global_Styles_Controller'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'update_item'
          3        DO_FCALL                                      0          
   46     4        NEW                                              $3      'Gutenberg_REST_Global_Styles_Controller_X_X'
          5        DO_FCALL                                      0          
          6        INIT_METHOD_CALL                                         $3, 'update_item'
          7        DO_FCALL                                      0          
   47     8        NEW                                              $6      'WP_REST_Global_Styles_Controller_X_X'
          9        DO_FCALL                                      0          
         10        INIT_METHOD_CALL                                         $6, 'update_item'
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

Class WP_REST_Global_Styles_Controller:
Function update_item:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J5u29
function name:  update_item
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                     '%0AWP_REST_Global_Styles_Controller%3A%3Aupdate_item%0A'
    6     1        INIT_METHOD_CALL                                         'prepare_item_for_database'
          2        DO_FCALL                                      0          
    7     3      > RETURN                                                   null

End of function update_item

Function prepare_item_for_database:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J5u29
function name:  prepare_item_for_database
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ECHO                                                     '%0AWP_REST_Global_Styles_Controller%3A%3Aprepare_item_for_database%0A'
   10     1        INIT_METHOD_CALL                                         'validate_custom_css'
          2        DO_FCALL                                      0          
   11     3      > RETURN                                                   null

End of function prepare_item_for_database

Function validate_custom_css:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J5u29
function name:  validate_custom_css
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ECHO                                                     'WP_REST_Global_Styles_Controller%3A%3Avalidate_custom_css%28%29%0A'
   15     1      > RETURN                                                   null

End of function validate_custom_css

End of class WP_REST_Global_Styles_Controller.

Class Gutenberg_REST_Global_Styles_Controller:
Function prepare_item_for_database:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J5u29
function name:  prepare_item_for_database
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   ECHO                                                     '%0AGutenberg_REST_Global_Styles_Controller%3A%3Aprepare_item_for_database%0A'
   22     1        INIT_METHOD_CALL                                         'validate_custom_css'
          2        DO_FCALL                                      0          
   23     3      > RETURN                                                   null

End of function prepare_item_for_database

Function validate_custom_css:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J5u29
function name:  validate_custom_css
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   ECHO                                                     'Gutenberg_REST_Global_Styles_Controller%3A%3Avalidate_custom_css%28%29%0A'
   32     1      > RETURN                                                   null

End of function validate_custom_css

Function update_item:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J5u29
function name:  update_item
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                     '%0AWP_REST_Global_Styles_Controller%3A%3Aupdate_item%0A'
    6     1        INIT_METHOD_CALL                                         'prepare_item_for_database'
          2        DO_FCALL                                      0          
    7     3      > RETURN                                                   null

End of function update_item

End of class Gutenberg_REST_Global_Styles_Controller.

Class Gutenberg_REST_Global_Styles_Controller_X_X:
Function prepare_item_for_database:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J5u29
function name:  prepare_item_for_database
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   ECHO                                                     '%0AGutenberg_REST_Global_Styles_Controller%3A%3Aprepare_item_for_database%0A'
   22     1        INIT_METHOD_CALL                                         'validate_custom_css'
          2        DO_FCALL                                      0          
   23     3      > RETURN                                                   null

End of function prepare_item_for_database

Function validate_custom_css:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J5u29
function name:  validate_custom_css
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   ECHO                                                     'Gutenberg_REST_Global_Styles_Controller%3A%3Avalidate_custom_css%28%29%0A'
   32     1      > RETURN                                                   null

End of function validate_custom_css

Function update_item:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J5u29
function name:  update_item
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                     '%0AWP_REST_Global_Styles_Controller%3A%3Aupdate_item%0A'
    6     1        INIT_METHOD_CALL                                         'prepare_item_for_database'
          2        DO_FCALL                                      0          
    7     3      > RETURN                                                   null

End of function update_item

End of class Gutenberg_REST_Global_Styles_Controller_X_X.

Class WP_REST_Global_Styles_Controller_X_X:
Function prepare_item_for_database:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J5u29
function name:  prepare_item_for_database
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E >   ECHO                                                     '%0AWP_REST_Global_Styles_Controller_X_X%3A%3Aprepare_item_for_database%0A'
   41     1        INIT_METHOD_CALL                                         'validate_custom_css'
          2        DO_FCALL                                      0          
   42     3      > RETURN                                                   null

End of function prepare_item_for_database

Function update_item:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J5u29
function name:  update_item
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                     '%0AWP_REST_Global_Styles_Controller%3A%3Aupdate_item%0A'
    6     1        INIT_METHOD_CALL                                         'prepare_item_for_database'
          2        DO_FCALL                                      0          
    7     3      > RETURN                                                   null

End of function update_item

Function validate_custom_css:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J5u29
function name:  validate_custom_css
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ECHO                                                     'WP_REST_Global_Styles_Controller%3A%3Avalidate_custom_css%28%29%0A'
   15     1      > RETURN                                                   null

End of function validate_custom_css

End of class WP_REST_Global_Styles_Controller_X_X.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.67 ms | 1457 KiB | 13 Q