LoginSignup
0
1

More than 5 years have passed since last update.

Symfony1.4 (PHP5.5) Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in

Last updated at Posted at 2015-11-26

symfony やったことないよ

いまさらなぜ symfony1かというと既存のソースが 1.4.xだから X(

まずは、ここを読んでみる

1.4 チュートリアル Jobeet 日本語

frontend_dev.php を表示してみると Σ(・_・)
sf1.jpg

原因 PHP5.5.0から preg_replaceの /e 修飾子が非推奨になりました。

preg_replace 変更履歴

対応情報1

Symfony 1.4 deprecated /e modifier

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in lib/vendor/symfony/…This changelog will solve the problem for all symfony 1.4.x. Tested on Symfony 1.4.20

lib/vendor/symfony/lib/command/sfCommandManager.class.php | 4 +++-
lib/vendor/symfony/lib/form/addon/sfFormObject.class.php | 2 +-
lib/vendor/symfony/plugins/sfDoctrinePlugin/lib/form/sfFormFilterDoctrine.class.php | 2 +-
lib/vendor/symfony/plugins/sfPropelPlugin/lib/form/sfFormFilterPropel.class.php | 2 +-
lib/vendor/symfony/lib/response/sfWebResponse.class.php | 2 +-
lib/vendor/symfony/lib/util/sfInflector.class.php | 5 +----
lib/vendor/symfony/lib/util/sfToolkit.class.php | 11 +++++++++++
7 files changed, 19 insertions(+), 9 deletions(-)

対応情報2

preg_replace() the /e modifier is deprecated

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in ----\lib\vendor\symfony\lib\util\sfToolkit.class.php on line 362

Replace:
return preg_replace(array_keys($replacePairs), array_values($replacePairs), $search);
With:
return strtr($search, $replacePairs);

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1