Tough girl In the fast lane No time for love No time for hate No drama, no time For games Tough girl Whose soul aches I'm at home On my own Check my phone Nothing, though Act busy Order in Pay TV It's agony I may cry, ruining my makeup Wash away all the things you've taken I don't care if I don't look pretty Big girls cry when their hearts are breaking Big girls cry when their hearts are breaking Big girls cry when their heart is breaking Tough girl I'm in pain It's lonely at the top Blackouts and airplanes I still pour you a glass of champagne I'm a tough girl Whose soul aches I'm at home On my own Check my phone Nothing, though Act busy Order in Pay TV It's agony I may cry, ruining my makeup Wash away all the things you've taken I don't care if I don't look pretty Big girls cry when their hearts are breaking Big girls cry when their hearts are breaking Big girls cry when their heart are breaking away i go away i go away i go away i go away i go away i go away i go alone I may cry, ruining my makeup Wash away all the things you've taken I don't care if I don't look pretty Big girls cry when their hearts are breaking Big girls cry when their hearts are breaking Big girls cry when their heart is breaking 最近在研究Challonge的API
在输出tournaments表的时候,看到了一个很奇怪的东西

    $tournamentsList = $api_instance[$key]->getTournaments()->tournament;
    print_r($tournamentsList);


输出结果如下

     SimpleXMLElement Object
(
    [id] => 2213854
    [name] => DFXRC first match
    [url] => DFXRC_first_match
    [description] => <strong>DFXRC</strong> is strong!
    [tournament-type] => single elimination
    [started-at] => 2016-02-04T00:05:26-08:00
    [completed-at] => SimpleXMLElement Object
        (
            [@attributes] => Array
                (
                    [type] => dateTime
                    [nil] => true
                )

        )
.....


看到那个started-at了没?没错!你没看错,变量名里面居然有减号!!!
按照PHP变量名的命名规范来说,这种变量名简直就是犯规啊!这要怎么访问??
按照常理来说,应该用

echo $tournamentsList->started-at


这样直接访问的,可是很明显,减号会被识别成运算符
这样语义就变成了变量start减变量at了
不出所料,打开页面返回HTTP 500= =
想了想,加引号试试

echo $tournamentsList->"started-at"


结果还是不行,直接语法错误
真是逼死人,直接再定义一个变量!

  $word="started-at";
  echo $tournamentsList->$word;


这样居然成功了!!天哪,访问个变量居然要定义两个变量,怎么这么麻烦!
正准备去给他们报个issue,结果看到前面已经有人提出来了
他们官方给出的访问方法居然是这样的...

echo (string)$tournament->{'tournament-type'};


真是长见识了,加花括号再加引号的访问变量= =,厉害厉害,佩服啊!