17
17
18
18
19
19
20
+ ////////////////////////////////////////////////////////////////////////////////
21
+ // HANDLE PHP VERSION SPECIFIC IMPLEMENTATIONS
22
+ ////////////////////////////////////////////////////////////////////////////////
23
+ if (version_compare (PHP_VERSION , '8.0.0 ' ) >= 0 ) {
24
+ require_once ('modern.php ' );
25
+ } else {
26
+ require_once ('legacy.php ' );
27
+ }
28
+
29
+
30
+
31
+
20
32
////////////////////////////////////////////////////////////////////////////////
21
33
// THE GETVAR CLASS ITSELF
22
34
////////////////////////////////////////////////////////////////////////////////
23
35
class getvar implements ArrayAccess {
36
+ use getvar_trait;
37
+
38
+
24
39
25
40
26
41
////////////////////////////////////////////////////////////////////////////
@@ -771,7 +786,7 @@ public function __set($key, $value) {
771
786
////////////////////////////////////////////////////////////////////////////
772
787
// ARRAYACCESS - WE ARE A READ/DELETE ONLY INSTANCE, THROW EXCEPTION
773
788
////////////////////////////////////////////////////////////////////////////
774
- public function offsetSet ($ key , $ value ) {
789
+ public function _offsetSet ($ key , $ value ) {
775
790
throw new Exception ('Cannot set values on class getvar ' );
776
791
}
777
792
@@ -791,7 +806,7 @@ public function __get($key) {
791
806
////////////////////////////////////////////////////////////////////////////
792
807
// ARRAYACCESS - GET THE $_GET/$_POST VALUE FOR THE GIVEN $KEY
793
808
////////////////////////////////////////////////////////////////////////////
794
- public function offsetGet ($ key ) {
809
+ public function _offsetGet ($ key ) {
795
810
return $ this ($ key );
796
811
}
797
812
@@ -819,7 +834,7 @@ public function __isset($key) {
819
834
////////////////////////////////////////////////////////////////////////////
820
835
// ARRAYACCESS - CHECK TO SEE IF $KEY EXISTS IN $_GET/$_POST
821
836
////////////////////////////////////////////////////////////////////////////
822
- public function offsetExists ($ key ) {
837
+ public function _offsetExists ($ key ) {
823
838
return isset ($ this ->{$ key });
824
839
}
825
840
@@ -847,7 +862,7 @@ public function __unset($key) {
847
862
////////////////////////////////////////////////////////////////////////////
848
863
// ARRAYACCESS - REMOVE A $KEY FROM $_GET/$_POST
849
864
////////////////////////////////////////////////////////////////////////////
850
- public function offsetUnset ($ key ) {
865
+ public function _offsetUnset ($ key ) {
851
866
unset($ this ->{$ key });
852
867
}
853
868
0 commit comments