Neden bu işe yaramadı?

2 Cevap

Ben yakut yapmak uzun sintra sonra bazı php kod yazma ve ben kaza bu yazdı:

[root@ip-10-160-47-98 test]# cat run.php
<?php

class MyTest {

   public function run() {
      var_dump(this.test);
   }
}

$object = new MyTest();
$object->run();
[root@ip-10-160-47-98 test]# php run.php
string(8) "thistest"
[root@ip-10-160-47-98 test]#

Şimdi, this.test bu-> testi $ olmalıydı, ama derleyici bu çalışmasına izin aslında mutlu oldu.

Herkes nasıl (this.test) bir dize "ThisTest" dönüştürülmüştür var biliyor mu?

Derleyen ve php 5.3.2 amazon örnek ami-e32273a6 (CentOS 5.4) çalıştırın

-Daniel

2 Cevap

this ve test örtülü dizelere dönüştürülür, ve . birleştirme operatörüdür.

Bu sabit ve sürekli test için php arama, onları bu kadar bir özel durum yükseltmek ve bu dönüştürmek bulmak doent ve 'bu' ve 'testi' ve onları joing test (nokta dizeleri katılmak için kullanılır)