第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會有你想問的

PHP 7.4 中包含/流過濾器發(fā)生了什么

PHP 7.4 中包含/流過濾器發(fā)生了什么

PHP
寶慕林4294392 2021-11-19 16:41:23
走!AOP 框架使用帶有 include 語句的流過濾器來執(zhí)行代理生成。它在 PHP 7.3 中運(yùn)行良好,但現(xiàn)在在 PHP 7.4 beta 2 發(fā)布后,它看起來有些變化。不幸的是,流過濾器的文檔很差,所以我無法檢查發(fā)生了什么。也許有經(jīng)驗(yàn)的人會知道。檢查以下示例代碼:// index.phpinclude __DIR__ . '/SampleFilter.php';SampleFilter::register();$uri = 'php://filter/read=sample.filter/resource='. __DIR__ . '/Sample.php';$content = file_get_contents($uri);include $uri;Sample::printIt();// SampleFilter.phpclass SampleFilter extends php_user_filter{    public const PHP_FILTER_READ = 'php://filter/read=';    public const FILTER_IDENTIFIER = 'sample.filter';    protected $data = '';    protected static $filterId;    public static function register(string $filterId = self::FILTER_IDENTIFIER) : void    {        if (!empty(self::$filterId))         {            throw new RuntimeException('Stream filter already registered');        }        $result = stream_filter_register($filterId, __CLASS__);        if ($result === false)        {            throw new Exception('Stream filter was not registered');        }        self::$filterId = $filterId;    }    public static function getId() : string    {        if (empty(self::$filterId))        {            throw new Exception('Stream filter was not registered');        }        return self::$filterId;    }    public function filter($in, $out, &$consumed, $closing)    {        while ($bucket = stream_bucket_make_writeable($in))        {            $this->data .= $bucket->data;        }如您所見,$content 已正確修改代碼(完整)。但是在包含該文件時(shí),它看起來像代碼被分割為原始文件長度。PHP 打印錯(cuò)誤:Parse error: syntax error, unexpected end of file in /(...)/Sample.php on line 9第 9 行是超出原始文件大小的地方。
查看完整描述

1 回答

?
MMMHUHU

TA貢獻(xiàn)1834條經(jīng)驗(yàn) 獲得超8個(gè)贊

這是一個(gè)錯(cuò)誤,在 PHP7.4 中引入。它已經(jīng)在最新版本中修復(fù)了。


查看完整回答
反對 回復(fù) 2021-11-19
  • 1 回答
  • 0 關(guān)注
  • 170 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號