3v4l.org

run code in 300+ PHP versions simultaneously
<?php function __( $content ) { return $content; } class WP_Locale { public $weekday; public function __construct() { $this->init(); $this->register_globals(); } public function init() { // The weekdays. $this->weekday[0] = /* translators: Weekday. */ __( 'Sunday' ); $this->weekday[1] = /* translators: Weekday. */ __( 'Monday' ); $this->weekday[2] = /* translators: Weekday. */ __( 'Tuesday' ); $this->weekday[3] = /* translators: Weekday. */ __( 'Wednesday' ); $this->weekday[4] = /* translators: Weekday. */ __( 'Thursday' ); $this->weekday[5] = /* translators: Weekday. */ __( 'Friday' ); $this->weekday[6] = /* translators: Weekday. */ __( 'Saturday' ); } public function register_globals() {} } // Should not throw a notice for: // Notice: Trying to access array offset on value of type null. $wp_locale = new WP_Locale(); var_dump( $wp_locale->weekday );

preferences:
27.77 ms | 402 KiB | 5 Q