PHP curly braces in array notation

前端 未结 5 1516
南笙
南笙 2020-11-30 12:20

I\'d just come across a very weird bit of php code:

$oink{\'pig\'} = 1;
var_dump($oink);

$oink{\'pig\'} = \'123123\';
echo $oink{\'pig\'}; /* => 123123 *         


        
5条回答
  •  自闭症患者
    2020-11-30 12:57

    Array and string offset access using curly braces is officially deprecated from PHP7.4 Ref: https://www.php.net/manual/en/migration74.deprecated.php

提交回复
热议问题