ningskyer
V2EX  ›  PHP

PHP $this->instance('path', $this->{$path.'Path'}());

  •  
  •   ningskyer · Apr 20, 2016 · 2822 views
    This topic created in 3809 days ago, the information mentioned may be changed or developed.

    这特么什么意思。。。

    $this->{$path.'Path'}()

    这是什么用法

    6 replies  •  2016-04-20 15:36:46 +08:00
    ningskyer
        1
    ningskyer  
    OP
       Apr 20, 2016
    $path 是个字符串变量
    jfcherng
        2
    jfcherng  
       Apr 20, 2016
    $this->{$path.'Path'}() = 調用名為 $path.'Path' 的方法
    geeglo
        3
    geeglo  
       Apr 20, 2016
    假设 $path = 'x';

    整句话 = $this->instance('path', $this->xPath());
    ningskyer
        5
    ningskyer  
    OP
       Apr 20, 2016
    @Slienc7 nice
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   843 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 20:44 · PVG 04:44 · LAX 13:44 · JFK 16:44
    ♥ Do have faith in what you're doing.