3v4l.org

run code in 300+ PHP versions simultaneously
<?php // From https://core.trac.wordpress.org/browser/trunk/wp-admin/includes/list-table.php?rev=15491. class WP_List_Table { /** * Various information about the current table * * @since 3.1.0 * @var array * @access private */ var $_args; /** * Various information needed for displaying the pagination * * @since 3.1.0 * @var array * @access private */ var $_pagination_args = array(); /** * The current screen * * @since 3.1.0 * @var object * @access protected */ var $screen; /** * Cached bulk actions * * @since 3.1.0 * @var array * @access private */ var $_actions; /** * Cached pagination output * * @since 3.1.0 * @var string * @access private */ var $_pagination; /** * Constructor. The child class should call this constructor from it's own constructor * * @param array $args An associative array with information about the current table * @access protected */ function WP_List_Table( $args = array() ) {} } function run_test() { $obj = new WP_List_Table(); echo "\n ***** TEST WP 3.1 CODE ***** \n\n\n"; // __get() echo "** Test get **\n"; echo "Defined property: "; var_dump( $obj->_args ); echo "Dynamic property: "; var_dump( $obj->_dynamic_property ); // __isset() echo "\n\n ** Test `isset()` **\n"; echo "Defined property: "; var_dump( isset( $obj->_args ) ); echo "Dynamic property: "; var_dump( isset( $obj->_dynamic_property ) ); // __set() echo "\n\n ** Test set **\n"; $new_value = array( 'test' ); $obj->_args = $new_value; $obj->_dynamic_property = $new_value; echo "With magic methods: "; var_dump( $obj->_args ); echo "Dynamic property: "; var_dump( $obj->_dynamic_property ); // Unset. unset( $obj->_args ); unset( $obj->_dynamic_property ); echo "\n\n ** Test get after `unset()` **\n"; echo "Defined property: "; var_dump( $obj->_args ); echo "Dynamic property: "; var_dump( $obj->_dynamic_property ); echo "\n\n ** Test `isset()` after `unset()` **\n"; echo "Defined property: "; var_dump( isset( $obj->_args ) ); echo "Dynamic property: "; var_dump( isset( $obj->_dynamic_property ) ); echo "\n\n ** Test set after `unset()` **\n"; $new_value = array( 'test after an unset' ); $obj->_args = $new_value; $obj->_dynamic_property = $new_value; echo "Defined property: "; var_dump( $obj->_args ); echo "Dynamic property: "; var_dump( $obj->_dynamic_property ); echo "\n\n ** Test `isset()` after `unset()` and set **\n"; echo "Defined property: "; var_dump( isset( $obj->_args ) ); echo "Dynamic property: "; var_dump( isset( $obj->_dynamic_property ) ); } run_test();

preferences:
24.59 ms | 404 KiB | 5 Q