0
我在調用對象的方法時遇到了分段錯誤。該方法實際上是在基類中實現的,我在我的站點的很多不同的地方調用了相同的方法,但是當我在這種特定情況下調用它時,我會遇到分段錯誤。php分段錯誤函數調用
print "<p>\$picture=" . print_r($picture, true) . "</p>\n";
// apply any changes passed in parameters
if (method_exists($picture, 'postUpdate'))
print "<p>object has a postUpdate method</p>\n";
else
print "<p>object does not have a postUpdate method</p>\n";
$picture->postUpdate(true);
如果我把exit命令之前立即調用postUpdate我看到:
$picture=LegacyPicture Object ([row:protected] => Array ([idbr] => 0 [idir] => 20553 [idtype] => 0 [pictype] => 0 [picorder] => 0 [picname] => [picnameurl] => [idbppic] => 1 [piccaption] => [picd] => [picsd] => [picdate] => [picdesc] => [picprint] => 0 [picsoundname] => [picsoundnameurl] => [idbpsound] => 0 [used] => 0 [picpref] => 1 [filingref] =>) [changed:protected] => Array () [table:Record:private] => tblBR [prime:Record:private] => idbr [needInsert:protected] => 1)
object has a postUpdate method.
如果我的方法postUpdate PHP得到一個分割故障的第一行放置一個退出命令。 postUpdate方法只是基於$ _POST更新對象的內容。沒有遞歸。該故障立即發生。在調用方法和引發分段錯誤的方法中的第一行代碼之間會出現什麼問題?在Apache 2.4.7上運行PHP 5.5.9。