@@ -22,16 +22,43 @@ public static function pushByPath(&$holder, $path, $value)
2222                && !is_int ($ key
2323                && false  === filter_var ($ keyFILTER_VALIDATE_INT )
2424            ) {
25+                 $ keystring )$ key
2526                $ refnew  \stdClass ();
26-                 $ ref$ ref$ key
27+                 $ ref$ ref{ $ key} ;
2728            } else  {
2829                $ ref$ ref$ key
2930            }
3031        }
3132        $ ref$ value
3233    }
3334
34-     public  static  function  getByPath (&$ holder$ path
35+     private  static  function  arrayKeyExists ($ keyarray  $ a
36+     {
37+         if  (array_key_exists ($ key$ a
38+             return  true ;
39+         }
40+         $ keystring )$ key
41+         foreach  ($ aas  $ k$ v
42+             if  ((string )$ k$ key
43+                 return  true ;
44+             }
45+         }
46+         return  false ;
47+     }
48+ 
49+     private  static  function  arrayGet ($ keyarray  $ a
50+     {
51+         $ keystring )$ key
52+         foreach  ($ aas  $ k$ v
53+             if  ((string )$ k$ key
54+                 return  $ v
55+             }
56+         }
57+         return  false ;
58+     }
59+ 
60+ 
61+     public  static  function  getByPath ($ holder$ path
3562    {
3663        $ pathItemsexplode ('/ ' , $ path
3764        if  ('# '  === $ pathItems0 ]) {
@@ -41,14 +68,14 @@ public static function getByPath(&$holder, $path)
4168        while  (null  !== $ keyarray_shift ($ pathItems
4269            $ keyurldecode ($ key
4370            if  ($ refinstanceof  \stdClass) {
44-                 $ varsget_object_vars ( $ ref) ;
45-                 if  (array_key_exists ($ key$ vars
46-                     $ ref$ vars [ $ key] ;
71+                 $ vars( array ) $ ref
72+                 if  (self :: arrayKeyExists ($ key$ vars
73+                     $ refself :: arrayGet ( $ key,  $ vars ) ;
4774                } else  {
4875                    throw  new  Exception ('Key not found:  '  . $ key
4976                }
5077            } else  {
51-                 if  (array_key_exists ($ key$ ref
78+                 if  (self :: arrayKeyExists ($ key$ ref
5279                    $ ref$ ref$ key
5380                } else  {
5481                    throw  new  Exception ('Key not found:  '  . $ key
0 commit comments