📜 ⬆️ ⬇️

PHP with arbitrary characters in the method name and variable

Sometimes I'm just amazed at the perverse flexibility of PHP.

 class t {
	 function __call ($ name, $ arg)
         {
		 echo __CLASS __, '::', $ name, '(', implode (',', $ arg), ')', PHP_EOL;
	 }
 }
 $ t = new T ();
 $ t -> {'$:)'} ();
 echo $ t -> {'test-sdfsdfsd'};
 $ Russian = 1;
 echo $ Russians;
 echo 'Ok';

 / * //
 it code say:
 t :: $:) ()
 1 Ok
 // * /

Although the ORM may take root ...

')

Source: https://habr.com/ru/post/26003/


All Articles