File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717 */
1818class SessionSection implements \IteratorAggregate, \ArrayAccess
1919{
20- /** Emits a warning when accessing an undefined variable in this section */
21- public bool $ warnOnUndefined = false ;
22-
23-
2420 /**
2521 * Do not call directly. Use Session::getSection().
2622 */
@@ -115,12 +111,7 @@ public function &__get(string $name): mixed
115111 trigger_error ("Reading from \$session-> $ name is deprecated, use \$session->get(' $ name') instead " , E_USER_DEPRECATED );
116112 $ this ->session ->autoStart (forWrite: true );
117113 $ data = &$ this ->getData ();
118- $ data ??= [];
119- if ($ this ->warnOnUndefined && !array_key_exists ($ name , $ data )) {
120- trigger_error ("The variable ' $ name' does not exist in session section " );
121- }
122-
123- return $ data [$ name ];
114+ $ data ??= []; return $ data [$ name ];
124115 }
125116
126117
You can’t perform that action at this time.
0 commit comments