3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Envato_Theme_Setup_Wizard { private static $_instance = null; private $theme_name = ''; private $envato_username = ''; 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() { $this->theme_name = 'HOBA'; $this->envato_username = 'THEMETEORY'; $this->oauth_script = 'http://themeteory.com/404.php'; } public function get_theme_name(){ return $this->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);
Output for 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Deprecated: Creation of dynamic property Envato_Theme_Setup_Wizard::$oauth_script is deprecated in /in/8qaGl on line 22 Fatal error: Uncaught Error: Cannot access private property Envato_Theme_Setup_Wizard::$theme_name in /in/8qaGl:33 Stack trace: #0 {main} thrown in /in/8qaGl on line 33
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27
Fatal error: Uncaught Error: Cannot access private property Envato_Theme_Setup_Wizard::$theme_name in /in/8qaGl:33 Stack trace: #0 {main} thrown in /in/8qaGl on line 33
Process exited with code 255.
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Fatal error: Cannot access private property Envato_Theme_Setup_Wizard::$theme_name in /in/8qaGl on line 33
Process exited with code 255.

preferences:
175.8 ms | 401 KiB | 209 Q