Php/php8のソースを表示
←
Php/php8
ナビゲーションに移動
検索に移動
あなたには「このページの編集」を行う権限がありません。理由は以下の通りです:
この操作は、次のグループに属する利用者のみが実行できます:
登録利用者
。
このページのソースの閲覧やコピーができます。
==基底クラスのメソッドの引数の数が合わない== zendのZend_Db_Table_Abstractを使ったクラスで、 を使ってたので、以下エラーがでた。 <pre> Method 'AbstractScoreDao::fetchRow()' is not compatible with method 'AbstractDao::fetchRow()'.intelephense(P1038) AbstractScoreDao::fetchRow </pre> 対策として、基底クラスのメソッドの引数に、合わせる。 修正前 public function fetchRow($where) 修正後 public function fetchRow($where = null, $order = null, $offset = null) ===fetchAllの場合=== 修正前 public function fetchAll($where) 修正後 public function fetchAll($where = null, $order = null, $count = null, $offset = null) ==クラス名の関数をconstructとして完全に使えなくなった== php7までは非推奨で、php8からは、完全に使えない。 __construnct()にする。 ==smartyのテンプレの使ってない変数の警告対応== エラー詳細 Warning: Undefined array key "key" 修正前 <pre> {{if $request.key}} </pre> 修正後 <pre> {{if isset($request.key)}} </pre> ===smartyのテンプレのincludeで使ってない変数の警告対応=== エラー詳細 Warning: Undefined array key "wordlike" 修正前 <pre> {{include file="parts/box.tpl" request=$request wordlike=$wordlike|default:''}} </pre> 修正後 <pre> {{include file="parts/box.tpl" request=$request wordlike=$wordlike|default:''}} </pre> ===smartyのテンプレのincludeで使ってない配列変数の警告対応=== エラー詳細 Warning: Undefined array key "request" 修正前 <pre> {{include file="parts/box.tpl" request=$request}} </pre> 修正後 <pre> {{include file="parts/box.tpl" request=$request|default:[]}} </pre> ===smarty3について、php8だとエラーが出る=== 2026/4時点の最新smarty3.1.48だと、エラーがでる。 <pre> Fatal error: Type of SmartyCompilerException::$line must be int (as in class Exception) in smarty-3.1.48/libs/sysplugins/smartycompilerexception.php on line 8 </pre> ===smarty3について、php8だと警告が出る=== smarty3.1.39に落としても、別の箇所で、警告がでる。 <pre> Warning: Undefined array key "start_time" in smarty-3.1.48/libs/sysplugins/smarty_internal_debug.php on line 146 Warning: Undefined array key "start_template_time" in smarty-3.1.48/libs/sysplugins/smarty_internal_debug.php on line 73 </pre> ==Staticがついてないエラー== Staticコールが、できなくなって強制的に、エラー画面がでる。 エラー詳細 Non-static method SessionModel::getInstance() cannot be called statically 対応前 public function getInstance() 対応後 public static function getInstance() ==list取得が配列が存在しない警告になる場合== エラー詳細 Warning: Undefined array key 1 修正前 list($dummy, $dummy, $uri_domain) = explode("/", $target); 修正後 $parts = explode("/", $target, 3); $uri_domain = $parts[2] ?? ''; ==.htaccessにmagic_quotes_gpcがあると500エラー== .htaccess内に以下があれば、消す。 php_flag magic_quotes_gpc Off ==Zend_Db_Table_Abstractの書き換え== <pre> $adapter = $this->getAdapter(); $select = $adapter->select(); - $exp = 'SUM(wintimes) wintimes, SUM(losetimes) losetimes'; + $exp = [ + 'wintimes' => new Zend_Db_Expr('SUM(wintimes)'), + 'losetimes' => new Zend_Db_Expr('SUM(losetimes)') + ]; $select->from($this->_name, $exp,$this->_schema); return $adapter->fetchRow($select); </pre>
Php/php8
に戻る。
ナビゲーション メニュー
個人用ツール
ログイン
名前空間
ページ
議論
日本語
表示
閲覧
ソースを閲覧
履歴表示
その他
検索
案内
プログラムメモ
php
flutter
java
android
kotlin
ios
unity
unrealengine
javascript
mysql
sqlite
postgresql
oracle
mroonga
mongodb
flash
electron
cocos2dx
titanium
cpp
ruby
perl
python
accessメモ
rss
html
monaca
cordova
golang
blender
セキュリティ
テストツール
サーバメモ
linux
dotnet
apacheメモ
htaccessメモ
subversion
git
仮想サーバ
ansible
sendgrid
xampp
cacti
mecab
faces
flashpolicyd
fcs
jenkins
運用
デザインメモ
css
ユーザビリティ
ux
サービスメモ
twitter
facebook
instagram
mixi
セカンドライフ
通信ログ横取り
google
ustream
aws
gcp
plesk
azure
vps
AI
その他サービス
便利系メモ
SEO
モバイル
抽象変数名
DDD
クライアント
firefox
chrome
pgp
windows
mac
jmetar
Thunderbird
excel
libreoffice
vpnclient
doxygen
VisualStudioCode
fastlane
metaquest
cmsメモ
mediawiki
pukiwiki
wordpress
その他
資格
IT用語
pvを稼ぐ方法
将棋プログラム
その他
ログイン
ページ内
メインページ
最近の更新
人気のページ
問い合わせ
ツール
リンク元
関連ページの更新状況
ページ情報