Advertisement
fruffl

__set calls 2 times?

Aug 20th, 2012
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.96 KB | None | 0 0
  1. <?
  2.     class foo
  3.     {
  4.         /* note: $this->____baz is not defined as var */
  5.         public function __set($index, $value)
  6.         {
  7.             var_dump(debug_backtrace(0,1));
  8.             $foo = $this->filterApply('arx', __METHOD__, array('i' => $index, 'v' => $value));
  9.             $index = $foo['i'];
  10.             $this->____baz = $index;
  11.         }
  12.     }
  13. ?>
  14.  
  15. result:
  16. array(1) {
  17.   [0]=>
  18.   array(6) {
  19.     ["file"]=>
  20.     string(48) "/var/www/web/dev/index.php"
  21.     ["line"]=>
  22.     int(32)
  23.     ["function"]=>
  24.     string(5) "__set"
  25.     ["class"]=>
  26.     string(18) "ILLI\System\Object"
  27.     ["type"]=>
  28.     string(2) "->"
  29.     ["args"]=>
  30.     array(2) {
  31.       [0]=>
  32.       &string(3) "baz"
  33.       [1]=>
  34.       &string(3) "bar"
  35.     }
  36.   }
  37. }
  38. array(1) {
  39.   [0]=>
  40.   array(6) {
  41.     ["file"]=>
  42.     string(79) "/var/www/web/dev/ILLI/3.0.2/VENDOR/ILLI/System/Object.php"
  43.     ["line"]=>
  44.     int(84)
  45.     ["function"]=>
  46.     string(5) "__set"
  47.     ["class"]=>
  48.     string(18) "ILLI\System\Object"
  49.     ["type"]=>
  50.     string(2) "->"
  51.     ["args"]=>
  52.     array(2) {
  53.       [0]=>
  54.       &string(7) "____baz" <----------- WTF!
  55.       [1]=>
  56.       &string(34) "***ILLI\SYSTEM\FOO::FINDEX->BAZ***"
  57.     }
  58.   }
  59. }
  60.  
  61.  
  62. object(ILLI\System\UUID)#16 (12) {
  63.   ["__value":"ILLI\System\UUID":private]=>
  64.   string(36) "38355331-5271-445a-a962-74372e334979"
  65.   ["__splHashRegisterAddress":"ILLI\System\Object":private]=>
  66.   NULL
  67.   ["__adapterTracesEnabled":"ILLI\System\Object":private]=>
  68.   bool(false)
  69.   ["__adapterTraces":"ILLI\System\Object":private]=>
  70.   array(0) {
  71.   }
  72.   ["__adapters":protected]=>
  73.   array(0) {
  74.   }
  75.   ["__observerTracesEnabled":"ILLI\System\Object":private]=>
  76.   bool(false)
  77.   ["__observerTraces":"ILLI\System\Object":private]=>
  78.   array(0) {
  79.   }
  80.   ["__observers":protected]=>
  81.   array(0) {
  82.   }
  83.   ["__filterTracesEnabled":"ILLI\System\Object":private]=>
  84.   bool(false)
  85.   ["__filterTraces":"ILLI\System\Object":private]=>
  86.   array(1) {
  87.     ["ILLI\System\Object::__set"]=>
  88.     array(2) {
  89.       ["ILLI\System\Foo::findex"]=>
  90.       array(2) {
  91.         [0]=>
  92.         array(2) {
  93.           ["i"]=>
  94.           string(34) "***ILLI\System\Foo::findex->baz***"
  95.           ["v"]=>
  96.           string(34) "***ILLI\System\Foo::findex->bar***"
  97.         }
  98.         [1]=>
  99.         array(2) {
  100.           ["i"]=>
  101.           string(38) "***ILLI\System\Foo::findex->____baz***"
  102.           ["v"]=>
  103.           string(65) "***ILLI\System\Foo::findex->***ILLI\SYSTEM\FOO::FINDEX->BAZ******"
  104.         }
  105.       }
  106.       ["ILLI\System\Foo::toUpper"]=>
  107.       array(2) {
  108.         [0]=>
  109.         array(2) {
  110.           ["i"]=>
  111.           string(34) "***ILLI\SYSTEM\FOO::FINDEX->BAZ***"
  112.           ["v"]=>
  113.           string(34) "***ILLI\SYSTEM\FOO::FINDEX->BAR***"
  114.         }
  115.         [1]=>
  116.         array(2) {
  117.           ["i"]=>
  118.           string(38) "***ILLI\SYSTEM\FOO::FINDEX->____BAZ***"
  119.           ["v"]=>
  120.           string(65) "***ILLI\SYSTEM\FOO::FINDEX->***ILLI\SYSTEM\FOO::FINDEX->BAZ******"
  121.         }
  122.       }
  123.     }
  124.   }
  125.   ["__filters":protected]=>
  126.   array(1) {
  127.     ["ILLI\System\Object::__set"]=>
  128.     array(2) {
  129.       [0]=>
  130.       object(ILLI\System\FilterAlias)#17 (3) {
  131.         ["__event":"ILLI\System\FilterAlias":private]=>
  132.         string(3) "arx"
  133.         ["__TRIGGER":"ILLI\System\FilterAlias":private]=>
  134.         object(ILLI\System\Method)#19 (3) {
  135.           ["__class":protected]=>
  136.           string(18) "ILLI\System\Object"
  137.           ["__function":protected]=>
  138.           string(5) "__set"
  139.           ["__method":protected]=>
  140.           string(25) "ILLI\System\Object::__set"
  141.         }
  142.         ["__FILTER":"ILLI\System\FilterAlias":private]=>
  143.         object(ILLI\System\InvokeMethod)#23 (1) {
  144.           ["__callable":protected]=>
  145.           object(ILLI\System\Method)#25 (3) {
  146.             ["__class":protected]=>
  147.             string(15) "ILLI\System\Foo"
  148.             ["__function":protected]=>
  149.             string(6) "findex"
  150.             ["__method":protected]=>
  151.             string(23) "ILLI\System\Foo::findex"
  152.           }
  153.         }
  154.       }
  155.       [1]=>
  156.       object(ILLI\System\FilterAlias)#26 (3) {
  157.         ["__event":"ILLI\System\FilterAlias":private]=>
  158.         string(3) "arx"
  159.         ["__TRIGGER":"ILLI\System\FilterAlias":private]=>
  160.         object(ILLI\System\Method)#27 (3) {
  161.           ["__class":protected]=>
  162.           string(18) "ILLI\System\Object"
  163.           ["__function":protected]=>
  164.           string(5) "__set"
  165.           ["__method":protected]=>
  166.           string(25) "ILLI\System\Object::__set"
  167.         }
  168.         ["__FILTER":"ILLI\System\FilterAlias":private]=>
  169.         object(ILLI\System\InvokeMethod)#28 (1) {
  170.           ["__callable":protected]=>
  171.           object(ILLI\System\Method)#29 (3) {
  172.             ["__class":protected]=>
  173.             string(15) "ILLI\System\Foo"
  174.             ["__function":protected]=>
  175.             string(7) "toUpper"
  176.             ["__method":protected]=>
  177.             string(24) "ILLI\System\Foo::toUpper"
  178.           }
  179.         }
  180.       }
  181.     }
  182.   }
  183.   ["____baz"]=>
  184.   string(38) "***ILLI\SYSTEM\FOO::FINDEX->____BAZ***"
  185. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement