3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Envato_Theme_Setup_Wizard { public static $_instance = null; public static $theme_name = ''; public static $envato_username = ''; public static $oauth_script = ''; public static function instance() { if ( is_null( self::$_instance ) ) { self::$_instance = new self(); self::$_instance->init_globals(); //self::$_instance->init_actions(); } return self::$_instance; } public function init_globals() { self::$theme_name = 'HOBA'; self::$envato_username = 'THEMETEORY'; self::$oauth_script = 'http://themeteory.com/404.php'; } public function get_theme_name(){ return self::$theme_name; } } //var_dump(Envato_Theme_Setup_Wizard::get_theme_name); //$wizard = Envato_Theme_Setup_Wizard::instance(); //var_dump( $wizard->theme_name ); //var_dump( $wizard->envato_username ); //var_dump( $wizard->oauth_script ); //var_dump(Envato_Theme_Setup_Wizard::get_theme_name); class OS_Envato_Theme_Setup_Wizard extends Envato_Theme_Setup_Wizard { public static $_instance = null; public static $theme_name = ''; public static $envato_username = ''; public function init_globals() { var_dump(self::$theme_name); self::theme_name == 'HOBA_EXTENDED'; var_dump(self::$theme_name); } } $wizard2 = OS_Envato_Theme_Setup_Wizard::instance(); var_dump( $wizard2::$theme_name ); var_dump( $wizard2::$envato_username ); var_dump( $wizard2::$oauth_script ); var_dump( $wizard2::get_theme_name() );
Output for 8.1.28, 8.2.17 - 8.2.19, 8.3.4 - 8.3.7
string(4) "HOBA" string(10) "THEMETEORY" string(29) "http://themeteory.com/404.php" Fatal error: Uncaught Error: Non-static method Envato_Theme_Setup_Wizard::get_theme_name() cannot be called statically in /in/djrck:63 Stack trace: #0 {main} thrown in /in/djrck on line 63
Process exited with code 255.
Output for 5.5.31, 5.6.9, 5.6.20, 5.6.32 - 5.6.34, 7.0.2 - 7.0.3, 7.0.12 - 7.0.15, 7.0.21, 7.0.24, 7.1.0, 7.1.2, 7.1.4 - 7.1.5, 7.4.1

Process exited with code 137.
Output for 7.0.0 - 7.0.1, 7.0.4 - 7.0.11, 7.0.16 - 7.0.20, 7.0.22 - 7.0.23, 7.0.25 - 7.0.33, 7.1.1, 7.1.3, 7.1.6 - 7.1.33, 7.2.0 - 7.2.26, 7.3.0 - 7.3.13, 7.4.0
string(4) "HOBA" string(10) "THEMETEORY" string(29) "http://themeteory.com/404.php" Deprecated: Non-static method Envato_Theme_Setup_Wizard::get_theme_name() should not be called statically in /in/djrck on line 63 string(4) "HOBA"
Output for 5.5.0 - 5.5.30, 5.5.32 - 5.5.38, 5.6.0 - 5.6.8, 5.6.10 - 5.6.19, 5.6.21 - 5.6.31, 5.6.35 - 5.6.40
string(4) "HOBA" string(10) "THEMETEORY" string(29) "http://themeteory.com/404.php" Strict Standards: Non-static method Envato_Theme_Setup_Wizard::get_theme_name() should not be called statically in /in/djrck on line 63 string(4) "HOBA"

preferences:
152.09 ms | 403 KiB | 204 Q